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

Leandro Lucarella luca at llucax.com.ar
Thu Jan 26 05:14:55 PST 2012


Any thoughts on this?

I think a new release should be not too far and this will be bitting
people all around. At least it would be nice to know if it's
a regression or if people should have to change their code.

Leandro Lucarella, el 19 de enero a las 08:27 me escribiste:
> 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.
> 
> -- 
> Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
> ----------------------------------------------------------------------
> GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
> ----------------------------------------------------------------------
> Mi mami llevo a tu papi con el fuquete! Menéalo! Mi mami llevo a tu
> papi con el fuquete!
> 	-- Sidharta Kiwi
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
CAMPAÑA POR LA PAZ: APLASTARON JUGUETES BÉLICOS
	-- Crónica TV


More information about the dmd-internals mailing list