Closed charlesroddie closed 3 years ago
I have similar issues with struct tuples and ITuple interface here: https://github.com/dotnet/fsharp/issues/5654 However there is a "workaround" to make it work.
(box (System.ValueTuple.Create(1,2)) :?> System.IComparable<System.ValueTuple<int,int>>);;
Feeling pretty smug right now :-)
> ValueTuple.Create(37,300.2) :> IComparable<ValueTuple<int,double>>;;
val it : IComparable<struct (int * double)> = struct (37, 300.2)
gives
In the spec the types are compatible, and in C# this works fine:
F# reference tuples also fail, but this could be a missing feature rather than a casting issue: