www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3332] New: Mixin a constructor with a construct already present fails

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3332

           Summary: Mixin a constructor with a construct already present
                    fails
           Product: D
           Version: 1.047
          Platform: x86
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com


--- Comment #0 from Jacob Carlborg <doob me.com> 2009-09-19 15:04:10 PDT ---
The following code doesn't compile:

template C ()
{
    this (int i)
    {

    }
}

class A
{
    mixin C;

    this ()
    {

    }
}

void main ()
{
    auto a = new A(3);
}

The errors are: 
"main.d(23): Error: constructor main.A.this() does not match parameter types
(int)
main.d(23): Error: expected 0 arguments, not 1"

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 19 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3332


strtr despam.it changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |strtr despam.it


--- Comment #1 from strtr despam.it 2010-05-18 15:53:06 PDT ---
This one bit me as well today :(
Windows 
D1.061
Hack: renamed all constructors within the mixin to ctor.

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