Bug 5336 – Forward reference with template mixin and derived classes

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-12-09T08:04:00Z
Last change time
2015-06-09T05:12:00Z
Keywords
rejects-valid
Assigned to
nobody
Creator
robert
Blocks
340

Comments

Comment #0 by robert — 2010-12-09T08:04:45Z
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.
Comment #1 by robert — 2010-12-09T09:27:45Z
*** This issue has been marked as a duplicate of issue 4033 ***