Don't parse lambda as UDA without parentheses (#21009)

This brings the compiler's behavior in line with the language spec.

Fixes dlang/dlang.org#4137
This commit is contained in:
Paul Backus 2025-03-16 20:31:39 -04:00 committed by GitHub
parent 726c50e5bd
commit 7c95446800
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,3 @@
enum UDA;
int fun() @UDA => 7;
static assert(fun() == 7);

View file

@ -0,0 +1,7 @@
/+
TEST_OUTPUT:
---
fail_compilation/uda_lambda.d(7): Error: declaration expected, not `=>`
---
+/
@a => 7 int b;