Skip to content

Instantly share code, notes, and snippets.

@ImaginaryDevelopment
Created April 21, 2022 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImaginaryDevelopment/8eebe2765758ab035a9aa711c5e0ced3 to your computer and use it in GitHub Desktop.
Save ImaginaryDevelopment/8eebe2765758ab035a9aa711c5e0ced3 to your computer and use it in GitHub Desktop.
Using clause does not dispose in this case
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