-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language specIssues with the analyzer's implementation of the language specmodel-discrepancyDiscrepancies between analyzer and cfeDiscrepancies between analyzer and cfetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Example code:
int foo(bool something) =>
{if (something) ...throw "Badness" else 1: 2}.length;The CFE accepts the code as a map literal, and either throws or returns 1.
The analyzer reports:
This literal must be either a map or a set, but the elements don't have enough information for type inference to work.
The specification should end up in the case:
- If leaf elements has at least one
mapEntryand noexpressionElementelements, theneis a map literal with unknown static type. The static type will be filled in by type inference, defined below.
In those steps, the context type, S, is empty, ?, and there are no type arguments. There is precisely one leaf element, 1: 2, and the ... throw "Badness" spread element won't be looked at until we reach type inference.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.dart-model-analyzer-specIssues with the analyzer's implementation of the language specIssues with the analyzer's implementation of the language specmodel-discrepancyDiscrepancies between analyzer and cfeDiscrepancies between analyzer and cfetype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)