Closed
Description
void main(final List<String> value) {
final foo = value.isEmpty
? ([value[0]] as Iterable<String>) //warning: Unnecessary cast.
: [value].map((final value) => value);
foo.map;
}
when removing the cast:
void main(final List<String> value) {
final foo = value.isEmpty
? [value[0]]
: [value].map((final value) => value);
foo.map; //error: The getter 'map' isn't defined for the type 'Object'
}