Closed
Description
The System.Tuple.Create
methods are specially processed, so that their return types are considered "true" F# tuples, but the types System.Tuple<...>
are not similarly aliased to "true" F# tuples. This leads to the following peculiar situation:
Repro steps
let x: System.Tuple<int,int> = System.Tuple.Create(1,2)
Expected behavior
The code should compile without error.
Actual behavior
Error: FS0001 This expression was expected to have type 'System.Tuple<int,int>' but here has type ''a * 'b'
Known workarounds
- Omit type declaration:
let x = System.Tuple.Create(1,2)
. - Declare type as
int * int
instead ofTuple<int,int>
. - Create the tuple by calling the constructor:
let x: Tuple<int, int> = Tuple<_, _>( 1, 2 )