Closed
Description
A missing generic instantiation is causing a compile time error here:
sdk/tests/language/patterns/implicit_instantiation_test.dart
Lines 32 to 41 in 0d000e8
org-dartlang-app:/tests/language/patterns/implicit_instantiation_test.dart:36:24: Error: The argument type 'T Function<T>(T)' can't be assigned to the parameter type 'int Function(int)'.
if (Compare() case < c) {
^
In a discussion with @munificent he mentioned that this pattern match should have the same downward inference and generic instantiation as this similar code that doesn't contain any patterns and runs without any errors:
T id<T>(T t) => t;
typedef IntFn = int Function(int);
typedef TFn = T Function<T>(T);
class Compare {
operator <(IntFn f) {
print(f.runtimeType);
return f is TFn;
}
}
main() {
const c = id;
Compare() < c;
}