Skip to content

Commit a23e438

Browse files
committed
Use _ as context type for async return instead of FutureOr<_>
1 parent 87b0904 commit a23e438

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/type-system/inference.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ to find a value type `V` for that statement.
389389
are `return;` and `return e;` statements.
390390
* For a `return;` statement, let `V` be `Null`.
391391
* For a `return e;` statement, let `S` be the inferred type of `e`
392-
with typing context `FutureOr<K>`. Let `V` be **flatten**(`S`).
392+
with typing context `_` if `K` is `_`,
393+
and with typing context `FutureOr<K>` if `K` is not `_`,
394+
Let `V` be **flatten**(`S`).
393395

394396
- If the enclosing function is marked `sync*`, the relevant statements
395397
are `yield e;` or `yield* e;` statement.

0 commit comments

Comments
 (0)