Thread overview
January 20

I was looking at dmd source code and found an undocumented behavior:

@a=>7 int b;
pragma(msg, __traits(getAttributes, b)); // AliasSeq!((a) => 7)

D grammar allows lambda in UDA only inside parenthesis:

@(a=>7) int b;
pragma(msg, __traits(getAttributes, b)); // AliasSeq!((a) => 7)

So is this a bug in compiler or in grammar documentation?

January 20
https://issues.dlang.org/show_bug.cgi?id=24346
January 20

On Saturday, 20 January 2024 at 01:25:16 UTC, Richard (Rikki) Andrew Cattermole wrote:

>

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

Does this mean it's a bug? :)
tbh I'd like to try fixing it since I'm with that code atm.

January 20
On 20/01/2024 2:26 PM, Andrey Zherikov wrote:
> On Saturday, 20 January 2024 at 01:25:16 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> https://issues.dlang.org/show_bug.cgi?id=24346
> 
> Does this mean it's a bug? :)
> tbh I'd like to try fixing it since I'm with that code atm.

There is a bug here yes.

The problem is it might be a compiler bug, or it could be a specification bug.

Generally we consider the implementation to win on differences between the compiler and specification for issues such as this.

Given that it does not appear to be harmful, no need to change the compiler :)