Advertisement
Guest User

Untitled

a guest
May 21st, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. /// Passing generic type argument to to another function
  2.  
  3. class Hello {
  4. void world<T>(T a) {}
  5. }
  6.  
  7. class Bye {
  8. int a = 1;
  9. }
  10.  
  11. class Something extends Hello {
  12. @override
  13. void world<T>(T a) {
  14. printBye(a as Bye);
  15. }
  16. }
  17.  
  18. void printBye(Bye b) {
  19. print(b.a);
  20. }
  21.  
  22. main(){
  23. new Something()..world(new Bye());
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement