@@ -1057,22 +1057,23 @@ succintly, the syntax of Dart is extended to allow the following forms:
1057
1057
` T_1 ` . Since ` T_1 <: FutureOr<flatten(T_1)> ` for all ` T_1 ` , it follows that
1058
1058
` v ` must be an instance satisfying ` FutureOr<flatten(T_1)> ` , or
1059
1059
equivalently, satisfying ` FutureOr<T> ` . Therefore, ` v ` must either be an
1060
- instance satisfying either ` Future<T> ` or ` T ` . We consider the two cases
1061
- below._
1060
+ instance satisfying ` Future<T> ` , or if not, it must be an instance
1061
+ satisfying ` T ` . We consider the two cases below._
1062
1062
1063
1063
- If ` v ` is an instance satisfying type ` Future<T> ` , then let
1064
1064
` @AWAIT_WITH_TYPE_CHECK(m_1) ` evaluate to ` v ` .
1065
1065
1066
1066
- Otherwise, let ` @AWAIT_WITH_TYPE_CHECK(m_1) ` evaluate to a future satisfying
1067
1067
type ` Future<T> ` that will complete to the value ` v ` at some later
1068
1068
point. _ Such a future could, for instance, be created by executing
1069
- ` Future<T>.value(v) ` (this is sound because in this case ` v ` is an instance
1070
- satisfying ` T ` ) . It also could be created using a more efficient
1069
+ ` Future<T>.value(v) ` , which is sound because in this case ` v ` is an instance
1070
+ satisfying ` T ` . It also could be created using a more efficient
1071
1071
implementation-specific mechanism._
1072
1072
1073
- - _ Note that these two cases in the abstract correspond concretely to a type
1074
- check in the implementation; this where the name ` @AWAIT_WITH_TYPE_CHECK `
1075
- comes from._
1073
+ _ Note that the two cases here may imply a runtime implementation doing an
1074
+ actual ` is Future<T> ` type check and branching on the result, or a compiler
1075
+ may be able to optimize away the check in some cases. This where the name
1076
+ ` @AWAIT_WITH_TYPE_CHECK ` comes from._
1076
1077
1077
1078
- ` @CONCAT(m_1, m_2, ..., m_n) ` , where each ` m_i ` is an elaborated expression
1078
1079
whose static type is a subtype of ` String ` , represents the operation of
0 commit comments