Created
April 21, 2022 17:14
-
-
Save ImaginaryDevelopment/8eebe2765758ab035a9aa711c5e0ced3 to your computer and use it in GitHub Desktop.
Using clause does not dispose in this case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Foo () = | |
do | |
printfn "I'm constructed" | |
member x.Value | |
with get() = 0 | |
and set (v:int) = invalidOp "Hello world!" | |
interface IDisposable with | |
member x.Dispose() = | |
printfn "IDisposed!" | |
let run () = | |
use x = Foo(Value=4) | |
() | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment