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
[<Fact>]let``Struct DU case one`` ()=letf1= Field1 "F1"
f1.Should().BeOfCase(Field1)
then it works ok, but for the second case, e.g
[<Fact>]let``Struct DU case two`` ()=letf2= Field2 "F2"
f2.Should().BeOfCase(Field2)
Then i get
System.ArgumentException : This is not a valid tuple type for the F# reflection library. (Parameter 'types')
FSharpType.MakeTupleType(Type[] types) line 1148
[email protected](UnionCaseInfo unionCaseInfo) line 61
[email protected](a delegateArg0)
ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
[email protected](a a) line 32
MakeCaseTupleTypeCached.Static(UnionCaseInfo unionCaseInfo) line 79
[email protected](FSharpExpr expr) line 41
UnionAssertions.BeOfCase[a,b](Testable`1 t, FSharpExpr`1 caseConstructor, FSharpOption`1 because) line 47
BeOfCase.Struct DU case two() line 36
The text was updated successfully, but these errors were encountered:
Hi,
I was having a go at making some struct discriminated unions use shared/unnamed fields as described at https://learn.microsoft.com/en-us/dotnet/fsharp/whats-new/fsharp-9#field-sharing-for-struct-discriminated-unions in .NET 9 and hit an error in my unit tests.
Say I have a discriminated union like
If I have a unit test on the first case like
then it works ok, but for the second case, e.g
Then i get
The text was updated successfully, but these errors were encountered: