www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1498] New: Recursive mixins are not allowed

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

           Summary: Recursive mixins are not allowed
           Product: D
           Version: 1.021
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samukha voliacable.com


I and other people have asked in the NG about recursive mixins and got no
answer. Recursive mixins are probably tricky to implement but until they are
implemented or the specs clearly prohibit them, it is a bug (and major one with
respect to what I'm trying to do).

template Foos(Funcs...)
{
    static if (Funcs.length)
    {
        mixin Foos!(Funcs[1..$]);
    }
}

mixin Foos!(void function(), void function(int));

Error: mixin hello.Foos!(void(*)(),void(*)(int)).Foos!(void(*)(int)).Foos!()
recursive mixin instantiation


-- 
Sep 13 2007
next sibling parent BCS <ao pathlink.com> writes:
Reply to d-bugmail puremagic.com,

 http://d.puremagic.com/issues/show_bug.cgi?id=1498
 
 Summary: Recursive mixins are not allowed
 Product: D
 Version: 1.021
 Platform: PC
 OS/Version: Windows
 Status: NEW
 Severity: normal
 Priority: P2
 Component: DMD
 AssignedTo: bugzilla digitalmars.com
 ReportedBy: samukha voliacable.com
 I and other people have asked in the NG about recursive mixins and got
 no answer. Recursive mixins are probably tricky to implement but until
 they are implemented or the specs clearly prohibit them, it is a bug
 (and major one with respect to what I'm trying to do).
 
 template Foos(Funcs...)
 {
 static if (Funcs.length)
 {
 mixin Foos!(Funcs[1..$]);
 }
 }
 mixin Foos!(void function(), void function(int));
 
 Error: mixin
 hello.Foos!(void(*)(),void(*)(int)).Foos!(void(*)(int)).Foos!()
 recursive mixin instantiation
 
static foreach should cover this
Sep 13 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1498






True, but it's going to be D 2.0 feature and remain a bug/undefined behavior in
D 1.0 (which I am confined to because of Tango/DFL).


-- 
Sep 13 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1498


Christian Kamm <kamm-removethis incasoftware.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |kamm-removethis incasoftwar
                   |                            |e.de
         Resolution|                            |FIXED





2009-06-27 10:08:51 PDT ---
The test case passes for me with DMD 1.045 and seems to behave correctly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 27 2009