D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3250 - Template mixin with import + base class causes forward reference
Summary: Template mixin with import + base class causes forward reference
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Mac OS X
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-13 09:28 UTC by Jacob Carlborg
Modified: 2014-04-18 09:12 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2009-08-13 09:28:43 UTC
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 Rainer Schuetze 2009-09-18 02:05:16 UTC
I could not reproduce this bug with DMD 1.047 and DMD 2.032.
Comment 2 Jacob Carlborg 2009-09-18 12:14:33 UTC
You're right, I don't get the error with DMD 1.047. I guess I should close it?