[Issue 5336] New: Forward reference with template mixin and derived classes
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Dec 9 08:06:25 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5336
Summary: Forward reference with template mixin and derived
classes
Product: D
Version: D1 & D2
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: robert at octarineparrot.com
--- Comment #0 from Robert Clipsham <robert at octarineparrot.com> 2010-12-09 16:04:45 GMT ---
The following source:
base.d
----
template Template(T:Base)
{
}
class Base
{
}
----
derived.d
----
import base;
mixin Template!(Derived);
class Derived : Base {}
----
Produces the errors:
----
derived.d(3): Error: class derived.Derived base class is forward referenced by
Base
derived.d(2): Error: mixin Template!(Derived) does not match template
declaration Template(T : Base
----
When compiled with dmd1 and 2, using `dmd base.d derived.d`. Moving the mixin
after the definition of Derived seems to fix the error.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list