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
fix Issue 19922/19923 - ICE: using typeid() or .classinfo without TypeInfo_Class #9941
Conversation
Thanks for your pull request, @ibuclaw! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "stable + dmd#9941" |
@@ -4974,6 +4974,11 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor | |||
error(exp.loc, "Runtime type information is not supported for `extern(C++)` classes"); | |||
e = new ErrorExp(); | |||
} | |||
else if (!Type.typeinfoclass) | |||
{ | |||
error(exp.loc, "`object.TypeInfo_Class` could not be found, but is implicitly used"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add by typeid
to the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is consistent with the error message in no_TypeInfo.d, which the test is:
void test()
{
int i;
auto ti = typeid(i);
}
Which is identical to this, except getting the typeid of an int instead.
assert(Type.typeinfoclass); | ||
if (!Type.typeinfoclass) | ||
{ | ||
error(e.loc, "`object.TypeInfo_Class` could not be found, but is implicitly used"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add by classinfo
to the error message.
No description provided.