Skip to content

Commit 97c236e

Browse files
kevmalbaronfel
authored andcommitted
support struct tuple in leaf expression converter (#7144)
1 parent 23ea207 commit 97c236e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/fsharp/FSharp.Core/Linq.fs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,12 @@ module LeafExpressionConverter =
744744
Expression.Lambda(dty, bodyP, vsP) |> asExpr
745745

746746
| Patterns.NewTuple args ->
747-
let tupTy = args |> List.map (fun arg -> arg.Type) |> Array.ofList |> Reflection.FSharpType.MakeTupleType
747+
let tupTy =
748+
let argTypes = args |> List.map (fun arg -> arg.Type) |> Array.ofList
749+
if inp.Type.IsValueType then
750+
Reflection.FSharpType.MakeStructTupleType(inp.Type.Assembly, argTypes)
751+
else
752+
Reflection.FSharpType.MakeTupleType(argTypes)
748753
let argsP = ConvExprsToLinq env args
749754
let rec build ty (argsP: Expression[]) =
750755
match Reflection.FSharpValue.PreComputeTupleConstructorInfo ty with

0 commit comments

Comments
 (0)