Created
March 25, 2020 15:06
-
-
Save martinrybak/a35c51311bc0bb9145002aecbd09f2c1 to your computer and use it in GitHub Desktop.
Dart inheritance weirdness
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 Foo {} | |
class Bar extends Foo {} | |
void acceptsBar(Bar bar) {} | |
void main() { | |
Foo foo = Foo(); | |
acceptsBar(Foo()); // ERROR | |
acceptsBar(foo); // NO ERROR ?? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment