On Monday, 31 August 2015 at 19:10:45 UTC, jmh530 wrote:
module local;
struct S { int a = 2; }
module app;
import local : S;
void foo(S s)
{
import std.stdio : writeln;
writeln(s.a);
}
void bar()
{
import std.stdio : writeln;
import local : S;
S s;
writeln(s.a);
}
void main()
{
S s;
foo(s);
bar();
}
You can't use it with foo(S) because the type is used /outside/
the scope of the function, in its head. You have to qualify it (
void foo(local.S s) ) or import the type as:
{ import local: S;
void foo(S s) { ... }
}