[dmd-internals] Regression introduced by the fix for bug 314.

Martin Nowak dawg at dawgfoto.de
Thu Jan 26 10:04:14 PST 2012


On Thu, 19 Jan 2012 12:27:38 +0100, Leandro Lucarella <luca at llucax.com.ar>  
wrote:

> Speaking of regressions :)
>
> I will report this here for 2 reasons:
> 1) I don't know if bugs found in an unrelease version should be added to
>    bugzilla (I think they should, but I don't know the current policy).
> 2) I'm not sure the regression is a bug or a feature.
>
> This is how to reproduce the regression:
>
> 	echo 'module m1; struct S {}' > m1.d
> 	echo 'module m2; struct S {}' > m2.d
> 	echo 'module m3; import m1; import S = m2; S.S s;' > m3.d
> 	dmd -c m3.d
>
> This works without the fix, but with the fix I get this errors:
>
> 	m3.d(1): Error: m1.S at m1.d(1) conflicts with m2 at m3.d(1)
> 	m3.d(1): Error: no property 'S' for type 'S'
> 	m3.d(1): Error: S.S is used as a type
> 	m3.d(1): Error: variable m3.s voids have no value
>
> The only important is the first one. If you change m3 like this it works  
> again:
>
> 	echo 'module m3; import m1; import X = m2; alias X S; S.S s;' > m3.d
> 	                                   ^       ^^^^^^^^^
>
> I talked to Christian Kamm and he said this was somehow intentional,
> that a selective import shouldn't hide a previously defined symbol.
> I think it should be the same as using an alias, it's explicit enough to
> be sure I really want to use the specified symbol instead of any other
> else.
>
> I can't find anything so specific in the specs though, so I would like
> to know if there is already a well defined position about this and in
> the case that's not well specified, the specs should be improved to be
> more clear.
>
It's definitely a bug, can you please file it in bugzilla too.


More information about the dmd-internals mailing list