www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13226] New: Symbol is not accessible when using traits or mixin

https://issues.dlang.org/show_bug.cgi?id=13226

          Issue ID: 13226
           Summary: Symbol is not accessible when using traits or mixin
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: kozzi11 gmail.com

Created attachment 1374
  --> https://issues.dlang.org/attachment.cgi?id=1374&action=edit
source code example

//main.d:

import m.f;
class A {
    //class main.A member m is not accessible
    //mixin(t!(typeof(this), "m"));
    void m() {};
    //here is ok
    //mixin(t!(typeof(this), "m"));
}
void main(string[] args){}

//m.f
module m.f;
string t(alias cls, string method)() {
    import std.traits;
    static if (isSomeFunction!(__traits(getMember, cls, method))) 
{}
    return "";
}

But when I put content from m.f into main.d everything works ok. 
Or even when I change __traits(getMember, cls, method) to cls.m 
everything works. It also does not work with mixin (mixin("cls.m"))

--
Jul 30 2014