import 'dart:async';
class A { }
class B extends A { }
A f() => null;
Future<B> g() async => f();
void main() {
}
results in
$ pkg/vm/tool/dart2 /tmp/yyy.dart 254 ↵
file:///tmp/yyy.dart:8:24: Error: A value of type '#lib1::A' can't be assigned to a variable of type 'dart.async::FutureOr<#lib1::B>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<#lib1::B>'.
Future<B> g() async => f();
^
file:///tmp/yyy.dart:8:24: Error: A value of type '#lib1::A' can't be assigned to a variable of type 'dart.async::FutureOr<#lib1::B>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<#lib1::B>'.
Future<B> g() async => f();
Analyzer does not report an error here unless I run it with --no-implicit-casts.
@leafpetersen @eernstg @lrhn can you confirm which behavior is correct?