Pathological import symbol shadowing

Walter Bright newshound2 at digitalmars.com
Sun Nov 15 09:06:16 UTC 2020


On 11/13/2020 2:57 PM, H. S. Teoh wrote:
> Just ran into this today:
> 
> 	void main() {
> 		int[string] aa;
> 		int x;
> 
> 		x = aa.get("abc", 123);	// OK
> 
> 		import std;
> 		x = aa.get("abc", 123);	// Error: template std.net.curl.get cannot deduce function from argument types ...
> 
> 		import std, object;
> 		x = aa.get("abc", 123);	// OK
> 	}

Using:

     import std;

is a bad idea.



More information about the Digitalmars-d mailing list