You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dart analyzer does not report an error when a function with one parameter is invoked and the type of an actual argument is not a subtype of a formal argument type. Generated code reports a run-time exception type 'S0' is not a subtype of type 'Future'.
import"dart:async";
classS0 {}
FutureOr<S0> t0Instance =newS0();
// S0 is not a subtype of Future<S0>Future<S0> t1Instance =newFuture<S0>.value(newS0());
f1(Future<S0> t1) {}
main() {
f1(t0Instance); // <- exception
}
dart test.dart
Unhandled exception:
type 'S0' is not a subtype of type 'Future'
#0 main (file:///home/ngl/dart_wd/dtests/co19/LanguageFeatures/Subtyping/static/generated/ztest1.dart:10:6) #1 _startIsolate. (dart:isolate/runtime/libisolate_patch.dart:279:19) #2 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)
Tested with Dart VM version: 2.0.0-dev.68.0 (Tue Jul 10 14:47:26 2018 +0200) on "linux_x64"
The text was updated successfully, but these errors were encountered:
Dart analyzer does not report an error when a function with one parameter is invoked and the type of an actual argument is not a subtype of a formal argument type. Generated code reports a run-time exception type 'S0' is not a subtype of type 'Future'.
Tested with Dart VM version: 2.0.0-dev.68.0 (Tue Jul 10 14:47:26 2018 +0200) on "linux_x64"
The text was updated successfully, but these errors were encountered: