[Issue 12579] DMD rejects valid function literal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 15 16:52:38 PDT 2014


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

--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to brian-schott from comment #2)
> The compiler still rejects this:
> 
> void function() bar { writeln("test"); }
> 
> The grammar specification says this is valid. It does not require the '='
> token. If the compiler's behavior is correct, the specification needs to be
> changed.

Even if grammar accept the token list, it could be rejected in some reason.
In this case, it cannot be treated as a function definition, because of the
lack of parameter list.

More simple case is:

auto auto x = 1;

This is allowed in grammar, but will be rejected with the error "redundant
storage class 'auto'".

--


More information about the Digitalmars-d-bugs mailing list