Created
July 17, 2015 11:02
-
-
Save dsyme/d02446c3e139a7b81f28 to your computer and use it in GitHub Desktop.
Example of initialization unsoundness due to delayed interface implementation
This file contains 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
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