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"!
}
----
Comment #1 by andrej.mitrovich — 2014-05-12T10:46:10Z
Can confirm, also in git-head.
Comment #2 by nicolas.jinchereau — 2014-11-30T18:47:29Z
surprisingly, this issue is still not fixed in DMD 2.071.1. surprising, because if the template would be mixed in the same module, the import would be invisible.
Comment #5 by razvan.nitu1305 — 2022-08-25T10:00:52Z
This has been fixed in git master. The original bug report fails compilation with: " Error: undefined identifier `canFind`" and the sample code presented in https://issues.dlang.org/show_bug.cgi?id=12735#c2 now prints false twice.