Skip to content

Instantly share code, notes, and snippets.

@wyattbiker
Last active May 11, 2019 11:12
Show Gist options
  • Save wyattbiker/527e6692846bc018f929db7aea1af583 to your computer and use it in GitHub Desktop.
Save wyattbiker/527e6692846bc018f929db7aea1af583 to your computer and use it in GitHub Desktop.
Bye class
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());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment