-
-
Save VincentChalnot/1b479061df18181bc5b0 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
main() { | |
var subtest = new SomeSubClass(); | |
doSomething(subtest); | |
} | |
void doSomething(dynamic object) { | |
if (object is SomeClass) { | |
print((object as SomeClass).test()); | |
} | |
} | |
class SomeClass { | |
SomeClass(); | |
bool test() { | |
return true; | |
} | |
} | |
class SomeSubClass extends SomeClass { | |
SomeSubClass(); | |
bool test() { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment