Closed
Description
DDC is failing with CompileTimeErrors for tests/language/invalid_returns/async_valid_returns_test.dart. Here is a link to the failing logs.
Example code causing the error:
int vi = 0;
Future<int> async_dynamic_to_Future_int__e() async =>
vi as dynamic; // No await.
Example CompileTimeError for that code:
org-dartlang-app:/tests/language/invalid_returns/async_valid_returns_test.dart:489:8: 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'.
vi as dynamic; // No await.
^
I reached out to Erik, and he verified that with null-safe assignability rules this test should be valid since dynamic
is assignable to int
. It sounds like the spec has changed and this may be a new requirement with null-safety.