Created
April 7, 2016 08:37
-
-
Save alphaKAI/5477936ca5f7fca7fb0d17d6110bca3b 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 BASE {} | |
class A : BASE {} | |
BASE f(A a) {return a;} | |
void main() { | |
BASE b = new BASE; | |
A a = new A; | |
assert (typeid(b) == typeid(typeof(b))); // pass | |
assert (typeid(a) == typeid(typeof(a))); // pass | |
assert (typeid(f(a)) == typeid(typeof(f(a)))); // fail | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment