Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Bye {
- int a = 1;
- }
- class Say extends Bye {
- int a = 2;
- }
- void printBye<T extends Say>(T b) {
- print(b); // prints Instance of Bye
- print("a: ${b.a}"); // not an error anymore
- }
- void main() {
- printBye(Say());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement