Record types rejected as errors in constant initializer list #55247
Labels
analyzer-spec
Issues with the analyzer's implementation of the language spec
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Consider the following program:
This program is accepted and executed with no errors by
dart
, but the analyzer rejects it as follows:which is reported at
(int,)
, and the behavior is the same if we replace(int,)
by a different record type, e.g.,(int, int)
.This is not an error, and it is indeed not reported for several other occurrences of
(int,)
as a type in a constant expression.Hence, it looks like the analyzer emits a spurious error message in the combination of circumstances shown in the
A
constructor.[Edit: I did not need the assert after all, changed the title accordingly.]
The text was updated successfully, but these errors were encountered: