Closed
Description
The code below should print
(int) => void
(int) => void
and does so on ddc with kernel and ddc without kernel.
Run on the VM with --preview-dart-2, it prints the following:
(int) => void
Unhandled exception:
type '(T) => void' is not a subtype of type '(int) => void' of 'f'
#0 new A (file:///Users/leafp/tmp/ddctest.dart)
#1 main (file:///Users/leafp/tmp/ddctest.dart:13:13)
#2 _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
#3 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
typedef void Foo<T>(T x);
void foo<T>(T x) {}
class A<T> {
Foo<T> f;
A({this.f = foo});
}
main() {
Foo<int> f = foo;
print(f.runtimeType);
print(new A<int>().f.runtimeType);
}