mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
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:
parent
726c50e5bd
commit
7c95446800
3 changed files with 25 additions and 1 deletions
3
compiler/test/compilable/uda_lambda.d
Normal file
3
compiler/test/compilable/uda_lambda.d
Normal file
|
@ -0,0 +1,3 @@
|
|||
enum UDA;
|
||||
int fun() @UDA => 7;
|
||||
static assert(fun() == 7);
|
7
compiler/test/fail_compilation/uda_lambda.d
Normal file
7
compiler/test/fail_compilation/uda_lambda.d
Normal file
|
@ -0,0 +1,7 @@
|
|||
/+
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/uda_lambda.d(7): Error: declaration expected, not `=>`
|
||||
---
|
||||
+/
|
||||
@a => 7 int b;
|
Loading…
Add table
Add a link
Reference in a new issue