Identifier resolution, the great implementation defined mess.

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 21 07:03:00 PDT 2014


On 09/21/2014 03:53 PM, H. S. Teoh via Digitalmars-d wrote:
> I.e., this should work:
>
> 	string foo(string text) {
> 		import std.conv; // includes std.conv.text
> 		return "";	// but `text` is never referenced
> 	}
>
> but this should emit an error:
>
> 	string foo(string text) {
> 		import std.conv; // includes std.conv.text
> 		return text;	// error: parameter `text` conflicts with std.conv.text
> 	}

Why? That's inconsistent with how imports work at module scope. In the 
second example, 'text' should refer to the parameter.


More information about the Digitalmars-d mailing list