Bug 782 – Dmd crash with template class, alias, inheritance and severals files
Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-12-31T18:04:00Z
Last change time
2014-02-15T13:20:50Z
Assigned to
bugzilla
Creator
amaury.pouly
Comments
Comment #0 by amaury.pouly — 2006-12-31T18:04:51Z
Here is the code:(2 files)
[test.d]
import test2;
abstract class UpperClass
{
}
[test2.d]
import test;
abstract class MiddleClass : UpperClass
{
}
class Generic(T) : MiddleClass
{
T m_value=0;
}
alias Generic!(byte) GenericByte;
[/test2.d]
If I compile with:
dmd test.d test2.d
Then it crashes.
Some important facts about this issue:
-if everything is coded is one file, dmd compiles well
-if I import test2 AFTER the declaration of UpperClass and NOT BEFORE,
dmd compiles well
-if I remove "alias Generic!(byte) GenericByte;", dmd compiles well
-if I change "T m_value=0;" to "T m_value;", dmd compiles well
-if MiddleClass does not inherite from UpperClass or Generic inherite from
MiddleClass, dmd compiles well
When I say it compiles well of course, I mean without crashing
Comment #1 by bugzilla — 2007-01-01T00:25:44Z
For now, I can reduce this to a compile time forward reference error rather than a seg fault.