DIP 1016 should use expression lowering, not statement lowering

Adam D. Ruppe destructionator at gmail.com
Tue Jan 29 15:57:56 UTC 2019


On Tuesday, 29 January 2019 at 15:48:23 UTC, Andrei Alexandrescu 
wrote:
> On 1/29/19 10:44 AM, Nicholas Wilson wrote:
>>   if (auto val = expr(); val) { ... },
>
> Since we don't have these constructs, lowering would need to 
> explain what happens here.


Nitpick, but D has something very similar to that:

if(auto val = expr()) { ... }

it just depends on val implicitly casting to bool.

> It's okay if the resulting code is ugly, it won't be 
> user-visible.

We do have to be careful about this - error messages sometimes 
leak that ugly code out.


More information about the Digitalmars-d-announce mailing list