sdk
sdk copied to clipboard
Incorrect position of type arguments error on map and list literals
$ cat t.dart
main() {
print(<Object, Object, Object>[
1,
2,
3,
]);
}
$ ./fasta compile t.dart
t.dart:2:33: Warning: Too many type arguments on List literal.
print(<Object, Object, Object>[
^
The location should be:
$ ./fasta compile t.dart
t.dart:2:33: Warning: Too many type arguments on List literal.
print(<Object, Object, Object>[
^^^^^^^^^^^^^^^^^^^^^^^^
Or perhaps:
$ ./fasta compile t.dart
t.dart:2:33: Warning: Too many type arguments on List literal.
print(<Object, Object, Object>[
^^^^^^^^^^^^^^
In the analyzer this is highlighting the type parameter list (though I agree that highlighting the extra type arguments might make more sense). The CFE still highlights from[ to ].