www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5336] New: Forward reference with template mixin and derived classes

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: robert octarineparrot.com


--- Comment #0 from Robert Clipsham <robert 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: -------
Dec 09 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5336


Robert Clipsham <robert octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #1 from Robert Clipsham <robert octarineparrot.com> 2010-12-09
17:27:45 GMT ---
*** This issue has been marked as a duplicate of issue 4033 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 09 2010