-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
object.classinfo: Return a TypeInfo_Class instead of a TypeInfo_Interface #1532
Conversation
Could you also add a testcase for this? Perhaps something like: // RUN: %ldc -c -output-ll -of=%t.ll %s && FileCheck %s < %t.ll
class Node
{
final void _clone()
{
// CHECK-NOT: load %object.TypeInfo_Interface*
// CHECK: load %object.TypeInfo_Class*
this.classinfo.create();
}
} |
Thanks for the ready-to-paste test, but I'm not convinced this deserves a test on its own; it rather seems like a bug due to lack of focus or a typo to me, with an extremely low probability of being reintroduced. ;) Edit: But if there's really not a single test accessing a |
OK. Pretty much the first thing I think of now is: "does it have tests?" More tests, more better ;-) |
I'm pretty sure this typo isn't mine. ;) |
Opps, sorry misread :( |
LGTM, but I haven't tried it yet (I replaced all occurences with typeid). I wonder why this isn't lowered to TypeidExp in the front end, though. |
This may not be correct. |
According to the doc and Kenji, |
Updated so that .classinfo for interfaces returns a TypeInfo_Interface, as before and compatible to |
LGTM. It's compatible with dmd with respect to not returning the actual class for interfaces. |
This may be enough to fix #1471 (at least there's no crash anymore for @rainers' minimal testcase).