www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6475] New: template identifier is not a member of alias

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

           Summary: template identifier is not a member of alias
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ellery-newcomer utulsa.edu



20:07:06 PDT ---
inside this issue is a forward reference error, so it might just be a dup of
some other issue, but here it is anyways. A workaround exists and is expressed
in the code.

dmd32 2.054

the code:

struct SignalOnChange(L...) {
    static struct Inner(IndexedBy){
        static auto r(){
            Inner i;
            return i;
        }
    }
}

enum UseWhatWorks = false;

struct ContainerArgs(X...){
    static if(UseWhatWorks){
        alias typeof(X[0].Inner!(int).r()) Signals;
    }else{
        alias X[0] Signals0;
        alias Signals0.Inner!(int) Signals;
    }
}

class MIC(RawValue, Args...){
    alias ContainerArgs!(Args).Signals NormSignals;
}

void main(){
    alias MIC!(int,
            SignalOnChange!(int,int)) C;
}


the fireworks:

error11.d(26): Error: alias
error11.ContainerArgs!(SignalOnChange!(int,int)).ContainerArgs.Signals0
template identifier Inner is not a member of alias Signals0
error11.d(26): Error: alias
error11.ContainerArgs!(SignalOnChange!(int,int)).ContainerArgs.Signals0
template identifier Inner is not a member of alias Signals0
error11.d(27): Error: no property 'Inner!(int)' for type
'SignalOnChange!(int,int)'
error11.d(27): Error: alias
error11.ContainerArgs!(SignalOnChange!(int,int)).ContainerArgs.Signals cannot
alias an expression __error
error11.d(32): Error: template instance
error11.ContainerArgs!(SignalOnChange!(int,int)) error instantiating
error11.d(36):        instantiated from here:
MIC!(int,SignalOnChange!(int,int))
error11.d(32): Error: forward reference to 'Signals0.Inner!(int)'

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




20:13:37 PDT ---
a similar issue:

struct Sequenced(){
    struct Inner(){
        mixin template NodeMixin(){
            size_t i;
        }
    }
}

struct IndexedBy(L...)
{
    alias L List;
}

struct MNode(ThisContainer, IndexedBy, Signals, Value){
    alias Sequenced!().Inner!() ZZ; // ok
    alias Sequenced!() Y0;
    alias Y0.Inner!() Z0; // oh no!
}

class MIC(Value, Args...){
    alias MNode!(typeof(this), Args[0],int,Value) ThisNode;
}

void main(){
    alias MIC!(int,
            IndexedBy!(Sequenced!(),
                ),
            ) C;
}


produces:

error12.d(25): Error: alias
error12.MNode!(MIC,IndexedBy!(Sequenced!()),int,int).MNode.Y0 template
identifier Inner is not a member of alias Y0
error12.d(25): Error: alias
error12.MNode!(MIC,IndexedBy!(Sequenced!()),int,int).MNode.Y0 template
identifier Inner is not a member of alias Y0
error12.d(26): Error: no property 'Inner!()' for type 'Sequenced!()'
error12.d(26): Error: alias
error12.MNode!(MIC,IndexedBy!(Sequenced!()),int,int).MNode.Z0 cannot alias an
expression __error
error12.d(30): Error: template instance
error12.MNode!(MIC,IndexedBy!(Sequenced!()),int,int) error instantiating
error12.d(34):        instantiated from here:
MIC!(int,IndexedBy!(Sequenced!()))

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




12:04:15 PST ---
and again.
dmd 2.058 64 bit

code:

class Foo(Value){
    template T1(size_t n){ alias int T1; }
}
void main(){
    alias Foo!(int) C2;
    alias C2.T1!0 a1;
}

fireworks:

junk.d(5): Error: alias junk.main.C2 template identifier T1 is not a member of
alias C2

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


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com
           Platform|Other                       |All
         OS/Version|Linux                       |All



PDT ---
Also fails on 2.059 Win32

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



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

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




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/fa26c6c6f2129f1959469c8c7641f27e141e618c
fix Issue 6475 - template identifier is not a member of alias

https://github.com/D-Programming-Language/dmd/commit/e28e3987fe346509faecbaf8a701dea2b13a73d2


Issue 6475 - template identifier is not a member of alias

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 23 2012