Skip to content

Instantly share code, notes, and snippets.

@VincentChalnot
Created March 29, 2015 10:16
Show Gist options
  • Save VincentChalnot/1b479061df18181bc5b0 to your computer and use it in GitHub Desktop.
Save VincentChalnot/1b479061df18181bc5b0 to your computer and use it in GitHub Desktop.
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