-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-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.cfe-dysfunctionalitiesIssues for the CFE not behaving as intendedIssues for the CFE not behaving as intended
Description
The code below produce no issues in the analyzer but errors in CFE.
main() {
Map<void, int> m1 = <void, int>{};
void key = 0;
m1[key] = 1; // Error: This expression has type 'void' and can't be used.
Map<int, void> m2 = <int, void>{};
void value = 0;
m2[2] = value; // Error: This expression has type 'void' and can't be used.
}Acording to the specification key and value of type void in the []= operator are both allowed.
See also #57070.
Metadata
Metadata
Assignees
Labels
area-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.cfe-dysfunctionalitiesIssues for the CFE not behaving as intendedIssues for the CFE not behaving as intended