Bug 6995 – [CTFE] can't interpret static template method

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-11-23T04:48:00Z
Last change time
2011-12-17T20:50:36Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2011-11-23T04:48:56Z
struct Foo { static size_t index(size_t v)() { return v; } } enum s = Foo.index!(0)(); ---- CTFE internal error: cannot evaluate (Foo , index)() at compile time ---- In CallExp::semantic around line 7513: if (!f->needThis()) { VarExp *ve = new VarExp(loc, f); e1 = new CommaExp(loc, ue->e1, ve); e1->type = f->type; } a comma expression is created with ue->e1 being a TypeExp. The CTFE interpretation can't handle this case in CallExp::interpret.
Comment #1 by bugzilla — 2011-12-17T20:50:36Z