-
Notifications
You must be signed in to change notification settings - Fork 821
Labels
Area-ComputationExpressionsEnd-to-end experience for computation expressions (except async and state machine compilation)End-to-end experience for computation expressions (except async and state machine compilation)Feature Request
Milestone
Description
Is your feature request related to a problem? Please describe.
I am a bit surprised that use _
(discard) is valid, like in this code:
// okay
use _ = { new IDisposable with member _.Dispose() = printfn "disposed" }
// ...
...whereas use! _
is invalid, like in this code:
// error FS1228: 'use!' bindings must be of the form 'use! <var> = <expr>'
async {
use! _ = Async.OnCancel (fun () -> printfn "disposed")
// ...
}
I am also not getting good results when googling FS1288.
Describe the solution you'd like
I expect to be able to use the discard "pattern" (?) in both cases.
Perhaps this is more complicated to implement than it looks like at first glance.
Describe alternatives you've considered
I am currently using __
(double _
), which is exactly what I used before use _
became valid code.
Additional context
None.
shivinsky, kerams, auduchinok and BoundedChenn31
Metadata
Metadata
Assignees
Labels
Area-ComputationExpressionsEnd-to-end experience for computation expressions (except async and state machine compilation)End-to-end experience for computation expressions (except async and state machine compilation)Feature Request
Type
Projects
Status
Done