https://issues.dlang.org/show_bug.cgi?id=24525

Nick Treleaven <n...@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |n...@geany.org
           Severity|normal                      |enhancement

--- Comment #1 from Nick Treleaven <n...@geany.org> ---
Under https://dlang.org/spec/statement.html#NonEmptyStatementNoCaseNoDefault
grammar block it says:

> Any ambiguities in the grammar between Statements and Declarations are 
> resolved by the declarations taking precedence. 

For:
> ref () {return a;}() = 0;

A declaration `ref () {return a;}` gets parsed, not an ExpressionStatement. So
I think this issue is invalid.

It is unfortunate that the function literal syntax starting `ref` or `auto ref`
was added, when the function/delegate keyword starting forms can already handle
those.

--

Reply via email to