Commit 4026802
committed
Changes computation expression's Return to accept only unit.
Previously, Return accepted any type at all, but ignores the value. This leads to developers writing code like `return 1` which compiles but has no run-time effect, leaving the developer very confused. This computation expression's Return was not intended to be using explicitly with a `return` keyword but was added to allow the use of `do!`.
This commit changes Return to only accept unit to no longer allow explicit calls to return passing a value, but continue to allow `do!`.
Return is being removed from the signature file because of the inability to define the correct type signature. The signature is `unit -> AsyncSeq<'T>`, but the compiler interprets this as a function that has no parameters rather than a function that has a single parameter of type unit.1 parent 3512018 commit 4026802
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
0 commit comments