Skip to content

Instantly share code, notes, and snippets.

@dsyme
Created July 17, 2015 11:02
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 dsyme/d02446c3e139a7b81f28 to your computer and use it in GitHub Desktop.
Save dsyme/d02446c3e139a7b81f28 to your computer and use it in GitHub Desktop.
Example of initialization unsoundness due to delayed interface implementation
open System
type MyCollection() =
interface IDisposable
let d = new MyCollection()
(d :> IDisposable).Dispose()
let v = (printfn "hello"; [100])
type MyCollection<'T> with
interface IDisposable with
member x.Dispose() = printfn "v = %A" v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment