Code:

mixin template MIXIN(){
        import std.stdio;

        alias m = writeln;  //OK
}

class CLASS{

        mixin MIXIN;

alias wln1 = writeln; //Error: 'writeln' is not defined, perhaps you need to import std.stdio; ?
        alias wln2 = std.stdio.writeln; //OK
        void test(){
                wln2("test");                         //OK
std.stdio.writeln("test"); //Error: Deprecation: module std.stdio is not accessible here, perhaps add 'static import std.stdio;'
        }
}

Why 'alias wln1 = writeln;' doesnt't work but 'alias wln2 = std.stdio.writeln;' work when import is not static? Why 'wln2("test");' work but 'std.stdio.writeln("test");' doesn't? (changing import to static import doesn't change anything)

Reply via email to