You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let inline test (arg: ^T when ^T : struct) =
(^T : (member Item1: _) (arg))
[<EntryPoint>]
let main argv =
let a = test struct (1, 2)
0 // return an integer exit code
We'd certainly welcome the PR, but I don't think it's a priority for us given that pattern matching/deconstruction is the idiomatic way to work with tuples in F#.
That said, I'm labeling this as a regression since the error message did appear to not be an internal error at one point:
/Users/phillip/scratch/bar/Program.fs(54,13): error FS0001: A generic construct requires that the type 'struct ('a * 'b)' is a CLI or F# struct type
Though what it really should be saying is that struct (1, 2) does not support Item1 as a property
Just to add a bit of context: the initial issue mentions it's happening in Rider 2018.3.1 that uses FCS built from dev15.9 branch (with few additional patches) so the regression seems to not have appeared after recent changes in master.
Repro steps
Expected behavior
Pattern works as
ValueTuple
hasItem1
(?)Actual behavior
Related information
.NET Core SDK 2.2.101
The text was updated successfully, but these errors were encountered: