http://d.puremagic.com/issues/show_bug.cgi?id=2426
Summary: Assertion failure: 'type' on line 6308 in file
'expression.c'
Product: D
Version: 2.019
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: ice-on-valid-code
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
auto foo(T)(T v)
{
return v;
}
enum x = foo(1);
----
: Error: forward reference to type T
: Error: cannot implicitly convert expression (1) of type int to T
: Error: cannot cast int to T
Assertion failure: 'type' on line 6308 in file 'expression.c'
Compiles in a function scope:
auto foo(T)(T v)
{
return v;
}
void bar()
{
enum x = foo(1);
}
--