Thread overview
[Issue 1498] New: Recursive mixins are not allowed
Sep 13, 2007
d-bugmail
Sep 13, 2007
BCS
Sep 13, 2007
d-bugmail
Jun 27, 2009
Christian Kamm
September 13, 2007
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


-- 

September 13, 2007
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


September 13, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1498





------- Comment #2 from samukha@voliacable.com  2007-09-13 12:36 -------
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).


-- 

June 27, 2009
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




--- Comment #3 from Christian Kamm <kamm-removethis@incasoftware.de>  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: -------