-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Labels
BugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.Ready
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 * intinstead ofTuple<int,int>. - Create the tuple by calling the constructor:
let x: Tuple<int, int> = Tuple<_, _>( 1, 2 )
Metadata
Metadata
Assignees
Labels
BugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.Ready
