[Issue 9101] New: template mixin constructor causes link error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 1 03:25:08 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9101

           Summary: template mixin constructor causes link error
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2012-12-01 03:25:00 PST ---
With latest dmd from github, this code produces a link error:

class Node
{
    int id;

    this()
    {
    }

    this(int tok)
    {
        id = tok;
    }

    mixin template ForwardCtorNoId()
    {
        this() {} // default constructor needed for clone()

        this(int tok)
        {
            super(tok);
        }
    }
}

class Derived : Node
{
    mixin ForwardCtorNoId!();
}


void main()
{
}

This does not happen with dmd 2.060 and using bisect, it seems to be introduced
with this commit: 8bc59cfe8e6896435f20ce1e9bdcc226942f59a8 fix Issue 5893 -
Allow simple aliases for operator overloading

A work around seems to be to move the mixin declaration out of the base class
scope.

-- 
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