File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ Status: Draft
6
6
7
7
## CHANGELOG
8
8
9
+ 2020.07.14:
10
+ - Infer return type ` void ` from context with function literals.
11
+
9
12
2020.06.04:
10
13
- Make conflict resolution for override inference explicit.
11
14
@@ -318,9 +321,11 @@ The **actual returned type** of the function literal is the value of `T` after
318
321
all ` return ` and ` yield ` statements in the block body have been considered.
319
322
320
323
Let ` T ` be the ** actual returned type** of a function literal as computed above.
321
- Let ` R ` be the greatest closure of the typing context ` K ` as computed above. If
322
- ` T <: R ` then let ` S ` be ` T ` . Otherwise, let ` S ` be ` R ` . The inferred return
323
- type of the function literal is then defined as follows:
324
+ Let ` R ` be the greatest closure of the typing context ` K ` as computed above.
325
+ If ` R ` is ` void ` , or the function literal is marked ` async ` and ` R ` is
326
+ ` FutureOr<void> ` , let ` S ` be ` void ` . Otherwise, if ` T <: R ` then let ` S ` be
327
+ ` T ` . Otherwise, let ` S ` be ` R ` . The inferred return type of the function
328
+ literal is then defined as follows:
324
329
- If the function literal is marked ` async ` then the inferred return type is
325
330
` Future<flatten(S)> ` .
326
331
- If the function literal is marked ` async* ` then the inferred return type is
You can’t perform that action at this time.
0 commit comments