Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Passing generic type argument to to another function
- class Hello {
- void world<T>(T a) {}
- }
- class Bye {
- int a = 1;
- }
- class Something extends Hello {
- @override
- void world<T>(T a) {
- printBye(a as Bye);
- }
- }
- void printBye(Bye b) {
- print(b.a);
- }
- main(){
- new Something()..world(new Bye());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement