Submitted by William Blum on 10/17/2015 12:00:00 AM 11 votes on UserVoice prior to migration
The following code should issue a type checking error since return () should yield an Async<unit> and return 42 should yield an Async<int>.
let f c =
async {
return ()
printfn "You passed %A and I am returning 42" c
return 42
}
Additionally the following code should issue a warning since the return statement does not actually affect the flow of execution as the name suggests (The printf statement is actually executed).
let g c =
async {
return ()
printfn "You passed %A and I am returning 42" c
return ()
}
See comment in original submission. Approved in principle, though definitely subject to a more detailed satisfactory design (not to adhoc,not specific to “async”)
Submitted by William Blum on 10/17/2015 12:00:00 AM
11 votes on UserVoice prior to migration
The following code should issue a type checking error since
return ()
should yield anAsync<unit>
and return 42 should yield anAsync<int>
.Additionally the following code should issue a warning since the return statement does not actually affect the flow of execution as the name suggests (The printf statement is actually executed).
Original UserVoice Submission Archived Uservoice Comments