Returning a FutureOr
in an asynchronous function fails
#32233
Labels
legacy-area-analyzer
Use area-devexp instead.
Consider the following program:
The analyzer in strong mode responds as follows (when the program is stored in
n020.dart
):Presumably, this means that the returned expression in
bar
is checked in a manner which does not precisely correspond to the flatten function (from the language specification, sections Function Expressions and Return):But
Future<int>
may be assigned toFuture<num>
so the program should be accepted. Note that analysis of the same program succeeds withdartanalyzer --preview-dart-2
.The text was updated successfully, but these errors were encountered: