Skip to content
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

10452 CTFE: Cannot compare delegates with == or 'is' #2360

Merged

Conversation

donc
Copy link
Collaborator

@donc donc commented Jul 19, 2013

http://d.puremagic.com/issues/show_bug.cgi?id=10452

Delegate expressions weren't being interpreted properly. And delegate comparison wasn't implemented at all.
The tests here cover many more cases than are in the original bug report.

@@ -616,6 +616,7 @@ Expression *getAggregateFromPointer(Expression *e, dinteger_t *ofs)
assert(v);
StructLiteralExp *se = ex->op == TOKclassreference ? ((ClassReferenceExp *)ex)->value : (StructLiteralExp *)ex;
// We can't use getField, because it makes a copy
assert(se->elements);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

Don Clugston added 2 commits July 19, 2013 18:40
&expr.func needs to work for arbitrary expr, not just VarExp.
Tighten the CTFE sanity checks.
Support == and 'is' for delegates.
WalterBright added a commit that referenced this pull request Jul 21, 2013
10452  CTFE: Cannot compare delegates with == or 'is'
@WalterBright WalterBright merged commit 01c8a41 into dlang:master Jul 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants