Do you think if statement as expression would be nice to have in D?

Nick Treleaven nick at geany.org
Sun Jun 5 11:02:58 UTC 2022


On Sunday, 5 June 2022 at 11:02:13 UTC, Nick Treleaven wrote:
> On Sunday, 5 June 2022 at 00:48:04 UTC, Walter Bright wrote:
>> On 6/4/2022 9:15 AM, Nick Treleaven wrote:
>>> Just like `throw` is an expression in D now. It's type is 
>>> noreturn, which implicitly converts to any type.
>>
>> Which is causing unexpected problems :-/
>
> Isn't that more to do with nothrow expressions rather than 
> throw as an expression? If we support nothrow functions then we 
> get nothrow expressions. I could only find one throw expression 
> bug, and that seems like it's a nothrow issue.

I meant noreturn expression, not nothrow!


More information about the Digitalmars-d mailing list