Bug 2426 – Assertion failure: 'type' on line 6308 in file 'expression.c'
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-10-21T12:43:00Z
Last change time
2015-06-09T01:20:17Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
samukha
Comments
Comment #0 by samukha — 2008-10-21T12:43:28Z
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);
}