Thread overview
[Issue 9026] New: Template mixin identifier as template alias parameter doesn't work
Nov 15, 2012
Kenji Hara
Nov 15, 2012
Kenji Hara
Nov 19, 2012
Kenji Hara
Nov 21, 2012
Kenji Hara
Dec 29, 2012
Kenji Hara
November 15, 2012
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


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-14 21:13:35 PST ---
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: -------
November 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9026


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

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


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-14 21:19:18 PST ---
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: -------
November 19, 2012
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


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-18 16:45:50 PST ---
*** 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: -------
November 21, 2012
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: -------
December 29, 2012
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


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-12-28 23:39:37 PST ---
*** 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: -------