Symbol lookup rules and imports

Meta via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 4 17:27:04 PST 2014


> module base;
>
> class Base
> {
> 	import std.conv;
> }
>
> module derived;
> import base;
> import std.stdio;
>
> string text = "123";
>
> class Derived : Base
> {
> 	static void foo()
> 	{
> 		writeln(text);
> 	}
> }
>
> void main()
> {
> 	Derived.foo();
> }
>
> This prints an empty line!

My word, I think this example made me physically ill.



More information about the Digitalmars-d mailing list