Dicebot on leaving D: It is anarchy driven development in all its glory.

Nicholas Wilson iamthewilsonator at hotmail.com
Sat Aug 25 23:49:27 UTC 2018


On Saturday, 25 August 2018 at 20:52:06 UTC, Walter Bright wrote:
> On 8/25/2018 3:52 AM, Chris wrote:
>> On Friday, 24 August 2018 at 19:26:40 UTC, Walter Bright wrote:
>>> Every programmer who says this also demands new (and 
>>> breaking) features.
>> "Every programmer who..." Really?
>
> You want to remove autodecoding (so do I) and that will break 
> just about every D program in existence. For everyone else, 
> it's something else that's just as important to them.
>
> For example, Shachar wants partially constructed objects to be 
> partially destructed, a quite reasonable request. Ok, but 
> consider the breakage:
>
>   struct S {
>     ~this() {}
>   }
>
>   class C {
>     S s;
>
>     this() nothrow {}
>   }
>
> I.e. a nothrow constructor now must call a throwing destructor. 
> This is not some made up example, it breaks existing code:
>
>   https://github.com/dlang/dmd/pull/6816
>
> If I fix the bug, I break existing code, and apparently a 
> substantial amount of existing code. What's your advice on how 
> to proceed with this?

Run semantic3 on the constructor independent of the requirement 
to destruct already constructed objects. If the constructors is 
nothrow then there is no need to have the destructors run or the 
eh code at all, because no Exceptions can be thrown (an Error may 
be thrown but that will kill the program). This is how I intend 
to fix it after I refactor semantic3.



More information about the Digitalmars-d mailing list