www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9851] New: Mixed-in constructor is not taken into account during construction

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

           Summary: Mixed-in constructor is not taken into account during
                    construction
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-03-31
15:07:09 PDT ---
mixin template IntCtor()
{
    this(int x)
    {
    }
}

struct S
{
    mixin IntCtor!();
    this(string x) { }
}

void main()
{
    // Error: constructor test.S.this (string x) is not
    // callable using argument types (int)
    auto s = S(1);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 31 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9851


John Colvin <john.loughran.colvin gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.loughran.colvin gmail.
                   |                            |com


--- Comment #1 from John Colvin <john.loughran.colvin gmail.com> 2013-08-21
23:18:43 BST ---
not a bug, but there's no way around it barring string mixins. The mixin
constructs a scope and there is no overload resolution between it and the
enclosing scope.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 21 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9851


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

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


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-08-21
15:26:31 PDT ---
*** This issue has been marked as a duplicate of issue 8228 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 21 2013