-
Notifications
You must be signed in to change notification settings - Fork 847
Open
Labels
Milestone
Description
let disposable =
{ new IDisposable with member this.Dispose() = () }
let t =
task {
let i = 1
use encryptor = disposable
return 1
}
t.ResultIt's expected that there are 3 non-hidden sequence points inside the task expression.
However, excluding the hidden sequence points, the MoveNext method contains these sequence points:
Offset 7, (7, 9) - (7, 35)
Offset 8, (6, 9) - (6, 18)
Offset 10, (7, 9) - (7, 12)
Offset 28, (8, 9) - (8, 15)
There's an extra sequence point inserted for the use binding before the other sequence points, and it only consist of a single nop instruction.
This extra sequence point may significantly worsen the debugging experience, because it gives an impression that the code is executed in a wrong order:
- line 7 (
nop) - line 6 (
let i) - line 7 (actual
usecode) - line 8 (
return)
Workaround: not using use bindings in task expressions
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New