Last active
May 19, 2020 19:15
-
-
Save rofrankel/055d187a85ca14f2d3346ceb94956eb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class G {} | |
| class Foo<T extends G, F extends Foo<T, F, B>, B extends Bar<T, F, B>> {} | |
| class Bar<T extends G, F extends Foo<T, F, B>, B extends Bar<T, F, B>> {} | |
| class SubFoo extends Foo<G, SubFoo, SubBar> {} | |
| class SubBar extends Bar<G, SubFoo, SubBar> {} | |
| String works<T extends G, F extends Foo<T, F, B>, B extends Bar<T, F, B>>(Foo<T, F, B> foo) => foo.runtimeType.toString(); | |
| String fails<T extends G, F extends Foo<T, F, B>, B extends Bar<T, F, B>>(F foo) => foo.runtimeType.toString(); | |
| void main() { | |
| print(works(SubFoo())); | |
| print(fails(SubFoo())); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment