- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.7k
 
Closed
Labels
area-migration (deprecated)Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool).Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool).
Description
Consider the following code:
f<U>(Iterable<U> it) => it.where((s) => s != null);The migration tool changes this to:
import 'package:collection/collection.dart' show IterableNullableExtension;
f<U>(Iterable<U> it) => it.whereNotNull();However, this doesn't work because the signature of whereNotNull is:
extension IterableNullableExtension<T extends Object> on Iterable<T?> {
  Iterable<T> whereNotNull() => ...;
}When the type system tries to solve for a substitution T=... that makes the extension apply, it gets T=U, but that doesn't work because U is not a subtype of Object.
So the migration tool shouldn't change the where to whereNotNull in this case.
Metadata
Metadata
Assignees
Labels
area-migration (deprecated)Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool).Deprecated: this label is no longer actively used (was: issues with the `dart migrate` tool).