Thread overview | |||||
---|---|---|---|---|---|
|
April 20, 2005 cyclic classes/interfaces not rejected by dmd .121 | ||||
---|---|---|---|---|
| ||||
<code> class A:B{} class B:A{} </code> and <code> interface A:B{} interface B:A{} </code> are silently accepted by dmd. |
April 20, 2005 Re: cyclic classes/interfaces not rejected by dmd .121 | ||||
---|---|---|---|---|
| ||||
Posted in reply to zwang | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 zwang schrieb am Wed, 20 Apr 2005 16:05:47 +0800: ><code> > class A:B{} > class B:A{} ></code> > > and > ><code> > interface A:B{} > interface B:A{} ></code> > > are silently accepted by dmd. segfaults under Linux Added to DStress as http://dstress.kuehne.cn/nocompile/class_13.d http://dstress.kuehne.cn/nocompile/class_14.d http://dstress.kuehne.cn/nocompile/interface_15.d http://dstress.kuehne.cn/nocompile/interface_16.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCZk3d3w+/yD4P9tIRAihPAJ91qQZ1mwplvzoTKPamHvkjYso/qQCgq/tf uCGuxxlI24mJZDIfWGgkTCs= =0glA -----END PGP SIGNATURE----- |
April 21, 2005 Re: cyclic classes/interfaces not rejected by dmd .121 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kuehne | Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> zwang schrieb am Wed, 20 Apr 2005 16:05:47 +0800:
>
>><code>
>>class A:B{}
>>class B:A{}
>></code>
>>
>>and
>>
>><code>
>>interface A:B{}
>>interface B:A{}
>></code>
>>
>>are silently accepted by dmd.
>
>
> segfaults under Linux
>
> Added to DStress as
> http://dstress.kuehne.cn/nocompile/class_13.d
> http://dstress.kuehne.cn/nocompile/class_14.d
> http://dstress.kuehne.cn/nocompile/interface_15.d
> http://dstress.kuehne.cn/nocompile/interface_16.d
>
> Thomas
Hmm, if you think about it, it could actually be allowed (interfaces only, classes have an overload problem) - if A is a B and B is an A, obviously A equals B, and they could be merged, while both A and B become aliases to the merged interface.
OTOH, I see no absolutely no use this could have, and it's far more likely that a bug in the code is involved..
xs0
|
Copyright © 1999-2021 by the D Language Foundation