context pointer breaks getOverloads, shouldn't it be ignored by it?

arturg var.spool.mail700 at gmail.com
Mon Mar 12 10:50:06 UTC 2018


void main()
{
     class Foo
     {
         void fun(){}
     }

     foreach(m; __traits(allMembers, Foo))
     foreach(sym; __traits(getOverloads, Foo, m))
     {
     }
}

this fails with:

onlineapp.d(9): Error: no property this for type 
onlineapp.main.Foo
onlineapp.d(9): Error: (Foo).this cannot be resolved

it works fine if i add a `static if(m != "this")` or 
alternatively use std.meta.Erase("this", __traits(allMembers, 
Foo)).


More information about the Digitalmars-d-learn mailing list