Closed
Description
class Foo<T> {
Foo();
}
typedef Foo FooOperation<T>([T value]);
class FooOperator<T> {
FooOperation<T> op;
FooOperator(this.op);
}
Foo<String> start() {
FooOperator operation = FooOperator<String>(
([_]) => Foo<String>()
);
return operation.op();
}
main() {
start();
}
The above snippet passes in DDC but fails in CFE with:
Unhandled exception:
type '([String]) => Foo<String>' is not a subtype of type '([dynamic]) => Foo<dynamic>'
It seems that DDC is missing the function type check (i.e., dynamicToFooOfString._check()).
What's the expected behavior here? This pattern's being used quite a bit internally, so making this stricter will require some cleanup.