Bug 3250 – Template mixin with import + base class causes forward reference
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Mac OS X
Creation time
2009-08-13T09:28:00Z
Last change time
2014-04-18T09:12:03Z
Assigned to
nobody
Creator
doob
Comments
Comment #0 by doob — 2009-08-13T09:28:43Z
The following code causes forward reference:
template Mixin ()
{
import std.stdio; // it doesn't matter what import it is
int i;
}
class Bar : Foo
{
mixin Mixin;
}
class Foo
{
mixin Mixin;
}
Flip the class declarations to get the code to compile. The problem is harder to work around with the classes in individual modules.
Comment #1 by r.sagitario — 2009-09-18T02:05:16Z
I could not reproduce this bug with DMD 1.047 and DMD 2.032.
Comment #2 by doob — 2009-09-18T12:14:33Z
You're right, I don't get the error with DMD 1.047. I guess I should close it?