Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 19, 2012 [dmd-internals] Regression introduced by the fix for bug 314. | ||||
---|---|---|---|---|
| ||||
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
|
January 26, 2012 [dmd-internals] Regression introduced by the fix for bug 314. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leandro Lucarella | 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 |
January 26, 2012 [dmd-internals] Regression introduced by the fix for bug 314. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leandro Lucarella | By the way, I found another regression related to this: http://d.puremagic.com/issues/show_bug.cgi?id=7372 I don't think there is any chance this is intended behaviour, so I just reported the bug, even when it's not in a released version. Took ages to reduce to a simple test case :S -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- 1 cigarette takes away 5 minutes of a person's life |
January 26, 2012 [dmd-internals] Regression introduced by the fix for bug 314. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leandro Lucarella | 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.
|
January 26, 2012 [dmd-internals] Regression introduced by the fix for bug 314. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | Martin Nowak, el 26 de enero a las 19:04 me escribiste: > >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. http://d.puremagic.com/issues/show_bug.cgi?id=7373 -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- The world's best known word is "okay" The second most well-known word is "Coca-Cola" |
Copyright © 1999-2021 by the D Language Foundation