www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9026] New: Template mixin identifier as template alias parameter doesn't work

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

           Summary: Template mixin identifier as template alias parameter
                    doesn't work
           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: k.hara.pg gmail.com



From the digitalmars.d.learn forum:
http://forum.dlang.org/thread/xftbyifuuubxhhsolgpv forum.dlang.org

Code:
---
mixin template node() {
    static if (is(this == struct))
        alias typeof(this)* E;
    else
        alias typeof(this) E;  //Line5
    E prev, next;
}
struct list(alias N) {
    N.E head;
    N.E tail;
}
class A {
    mixin node L1;  //Line13
    mixin node L2;  //Line14
}
list!(A.L1) l1;  //Line16
list!(A.L2) l2;  //Line17
---

Output:
---
test.d(5): Error: this is not in a class or struct scope
test.d(5): Error: 'this' is only defined in non-static member functions, not
node!()
test.d(13): Error: mixin test.node!() error instantiating
test.d(16): Error: list!(L1) is used as a type
test.d(5): Error: this is not in a class or struct scope
test.d(5): Error: 'this' is only defined in non-static member functions, not
node!()
test.d(14): Error: mixin test.node!() error instantiating
test.d(17): Error: list!(L2) is used as a type
---

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/1289

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |japplegame gmail.com



*** Issue 9038 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: -------
Nov 18 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9026


Kenji Hara <k.hara.pg gmail.com> changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9026


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luka8088 owave.net



*** Issue 9233 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: -------
Dec 28 2012