Closed
Description
Consider:
import 'dart:async';
Future<int> foo() async {
dynamic x = 123;
return x;
}
main() {
foo();
}
This program runs fine normally, but if I run:
$ dart --enable-experiment=non-nullable temp.dart
Then I get:
temp.dart:9:10: Error: A value of type 'Future<dynamic>' can't be assigned to a variable of type 'FutureOr<int>'.
- 'Future' is from 'dart:async'.
- 'FutureOr' is from 'dart:async'.
return x;
^
From talking to @eernst, my understanding is that this code should continue to be allowed under null safety.