www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8228] New: Mixin template can't add constructor to class

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

           Summary: Mixin template can't add constructor to class
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



15:22:20 PDT ---
mixin template Root()
{
    this(int x) { }
    void test() { }
}

class Foo
{
    mixin Root;
    this()
    {
        test();   // OK
        this(1);  // FAIL
    }
}

void main() { }

It's ok to add virtual methods but not constructors. This has to be a bug..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 11 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8228


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

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



23:16:42 BST ---

 mixin template Root()
 {
     this(int x) { }
     void test() { }
 }
 
 class Foo
 {
     mixin Root;
     this()
     {
         test();   // OK
         this(1);  // FAIL
     }
 }
 
 void main() { }
 
 It's ok to add virtual methods but not constructors. This has to be a bug..
sadly, it's not a bug. template mixins create a scope and there's no overload resolution between it and it's enclosing scope. We should really have a way of doing a full mixin without resorting to strings. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8228




15:26:31 PDT ---
*** Issue 9851 has been marked as a duplicate of this issue. ***

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |enhancement


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