-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Consider the following code:
import 'dart:async';
void main() async {
final value = await fn();
print(value);
}
FutureOr<Object> fn() async {
return Future<Object>.value(42);
}
This should print 42
but actually prints Instance of '_Future<dynamic>'
Returning anything other than FutureOr<Object>
in fn
fixes the issue. This includes changing Object
to int
.
busslina, TekExplorer, lucavenir, StarProxima and codesculpture
Metadata
Metadata
Assignees
Labels
area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).Cross-cutting, high-level issues (for tracking many other implementation issues, ...).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)