Ok so this is driving me mad. how can this code possibly not work?
open System.Collections.Generic
type testing (a:int)=
let test = [Empty]
member p.GetHashCode =
fun () -> printfn "called hash";0
override p.Equals(other:obj) =
printfn "called equals"
true
interface IEquatable<testing> with
override p.Equals(other:testing) =
true
static member op_Equality (other:obj) = printfn "called op" ;true
let dict2 = new Dictionary<testing,int>()
dict2.[(testing 50)] <- 50
dict2.[(testing 50)]
The snippet dies when trying to fetch out of the dictionary and doesnt call any of the provided methods. Am I just crazy today or is there something wrong here?