Bug 12984 – [REG2.068a] ICE on forward reference of derived class from other instantiated class
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-24T19:03:00Z
Last change time
2015-06-17T21:04:00Z
Keywords
ice, pull, rejects-valid
Assigned to
nobody
Creator
nilsbossung
Comments
Comment #0 by nilsbossung — 2014-06-24T19:03:41Z
---
cat > test.d << code
template Tpl() {static if(true) enum Tpl = true;}
void f()() if(Tpl!());
class B {alias MyD = D!int;} // 4
class C : B {} // 5
class D(T) {alias MyE = E!float;}
class E(T) : D!int
{
void m()
{
auto c = new C; // 12
f(); // 13
}
}
code
dmd -c -o- test.d
---
test.d(2): Error: Cannot interpret Tpl!() at compile time
test.d(7): Error: template instance test.E!float error instantiating
test.d(4): instantiated from here: D!int
---
Works when lines 4 and 5 are swapped.
Works when lines 12 and 13 are swapped.
Possibly related to issue 12983.