Closed
Description
Consider:
typedef T Func1<T>();
// NOTE: return T here just so we can see what inferred type is.
// The actual expectAsync returns F.
T expectAsync<T, F extends Func1<T>>(F callback) {
// BUG: this is an implicit cast, but we should know it returns a T.
// BUG: this is a dynamic call but it shouldn't be.
return callback();
}
main() {
var y = expectAsync(() => 123);
// this inference seems to work.
int z = y;
print(z);
}