Closed
Description
The NNBD migration tool suggests casts for keys to Map.operator[]
.
This operation has argument type Object?
, so these casts are unnecessary, and in this case actually harmful since the code relies on lookups outside the map key type returning null
.
Example from sdk/pkg/compiler/js/rewrite_async.dart
An additional problem is that the migration tool will insert as Block
without ensuring Block
is imported, and does not use the library prefix. Both problems with the inserted cast create broken migrated code.