Skip to content

Commit

Permalink
Allow to return typeid from CTFE
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Stepanov authored and Igor Stepanov committed Apr 15, 2013
1 parent 911f788 commit 0447728
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/interpret.c
Expand Up @@ -1470,6 +1470,10 @@ Expression *SymOffExp::interpret(InterState *istate, CtfeGoal goal)
{
return this;
}
if((type->ty == Tclass)&&((Type::typeinfo == ((TypeClass*)type)->sym)||Type::typeinfo->isBaseOf(((TypeClass*)type)->sym, NULL)))
{
return this;
}
if (type->ty != Tpointer)
{ // Probably impossible
error("Cannot interpret %s at compile time", toChars());
Expand Down

0 comments on commit 0447728

Please sign in to comment.