DIP 1029---Add throw as Function Attribute---Community Review Round 1

Dennis dkorpel at gmail.com
Fri Feb 7 10:45:18 UTC 2020


On Friday, 7 February 2020 at 08:56:06 UTC, Walter Bright wrote:
>> ```
>> void foo()() {
>>      nothrow bar(); // allowed according to grammar spec
>>      throw bar(); // throw statement or function declaration?
>> }
>> ```
>
> I'm pretty sure the parser can take care of that with lookahead.

But which one is it?
I think declarations usually have priority (e.g. `A * b;` is 
always a declaration with pointer type instead of multiplication) 
but arguably parsing it as a throw statement makes more sense 
here.


More information about the Digitalmars-d mailing list