[Query] expression does not support [`ValueTuple`]
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
If I use `ValueTuple` in a query CE to execute query via EF Core 7
``` F#
let query = query {
for assessment in ctx.Set() do
select struct (assessment.TenantId, assessment.CompletedAt)
}
query.ToListAsync(cancellationToken)
```
I get `System.Exception: 'unreachable'`
**Describe the solution you'd like**
1. Current error must be more specific
2. `ValueTuple`s should be supported in this scenario
**Additional context**
Current code in the `FSharp.Core` 7.0.300
``` F#
let RewriteTupleType (ty: Type) conv =
// Tuples are generic, so lookup only for generic types
assert ty.IsGenericType
let generic = ty.GetGenericTypeDefinition()
match tupleToAnonTypeMap.TryGetValue generic with
| true, mutableTupleType ->
// Recursively transform type arguments
mutableTupleType.MakeGenericType(ty.GetGenericArguments() |> Array.toList |> conv |> Array.ofList)
| _ ->
assert false
failwith "unreachable
```

If the issue is about:
* related: #1103, #3782
Add any other context or screenshots about the feature request here.
Contributor guide
Assessment
This issue has not been assessed yet.