Bug 8234 – symbols used in CTFE affect the function literal type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-13T07:33:00Z
Last change time
2015-06-17T21:03:04Z
Keywords
pull
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2012-06-13T07:33:14Z
DMD 2.059:
void foo(){
immutable int x = 0;
static assert(is(typeof(*(){enum e=x;return e;})==function)); // fail
}
The static assertion should pass.
Comment #1 by clugdbug — 2012-06-26T23:48:13Z
This is not a CTFE bug.
void foo()
{
immutable int x = 0;
auto k = *(){enum e=x;return e;};
}
bug.d(4): Error: can only * a pointer, not a 'immutable(int) delegate() pure nothrow @safe'
Closure inference for 'is this a delegate literal' vs 'is this a function literal' incorrectly checks enum initializers.
Similar to bug 6169.