Skip to content

Instantly share code, notes, and snippets.

@alphaKAI
Created April 7, 2016 08:37
Show Gist options
  • Save alphaKAI/5477936ca5f7fca7fb0d17d6110bca3b to your computer and use it in GitHub Desktop.
Save alphaKAI/5477936ca5f7fca7fb0d17d6110bca3b to your computer and use it in GitHub Desktop.
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