[Issue 12735] New: imports via mixin template become public imports

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 11 22:24:04 PDT 2014


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

          Issue ID: 12735
           Summary: imports via mixin template become public imports
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: 2krnk at gmx.net

if module demo_i has an import declaration via mixin template it automatically
becomes a public import (that can be seen/used in all modules importing
demo_i).

(only tested with DMD 2.064.2)
----
module demo_i;

mixin template imp(){
    import std.algorithm;
}
mixin imp!();
----
----
module demo;

import std.stdio;
import demo_i;

enum teststr = "This should not work!";

void main(string[] args)
{
    writeln( canFind(teststr,"not") );  // works & prints "true"!
}
----

--


More information about the Digitalmars-d-bugs mailing list