Files
Johnni Winther f583a2bf73 [parser] Fix error reporting on const ()
The parser wrongly flagged any `const (...)` in a constant pattern
context and not just the intended `const ()`.

Closes #51415

Change-Id: Id7b0621cda4a144ac186dea55dbcbeaf041349bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283602
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-16 11:35:28 +00:00

5 lines
210 B
Dart

void foo() {
if (obj case (longFieldName: const (first: 1, second: 2))) {;}
if (obj case const (element, element, element, element)) {;}
if (obj case Foo(longFieldName: const (first: 1, second: 2))) {;}
}