Last active
November 30, 2022 13:33
-
-
Save osa1/dbdc827b31a55e35ad0a20ae5f5c5594 to your computer and use it in GitHub Desktop.
Strange Dart 4
This file contains 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 A { | |
void f() { | |
print('A.f called'); | |
} | |
} | |
class B implements A { | |
void f({int test}); // optional non-nullable with no default value, also not a valid override | |
// `f` above is not valid without a `noSuchMethod` | |
noSuchMethod(Invocation invocation) { | |
print('B.noSuchMethod'); | |
} | |
} | |
void main() { | |
B().f(); // prints "B.noSuchMethod" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment