[Issue 13028] New: [ICE] CTFE internal error: cannot evalute at compile time
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jul 2 19:17:36 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13028
Issue ID: 13028
Summary: [ICE] CTFE internal error: cannot evalute at compile
time
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: safety0ff.bugz at gmail.com
Removing the enum b = ___; line it works.
It would be nice if it would work when the parameter is compile-time evaluable.
int foo(int delegate() dg)
{
enum b = dg();
return b;
}
int bar(lazy int a)
{
enum b = a;
return a;
}
void main()
{
static assert(foo(()=>1) == 1);
static assert(bar(1) == 1);
}
--
More information about the Digitalmars-d-bugs
mailing list