Linq.Expressions array indexer get maps to GetArray, not get_Item #16918
Labels
Area-Queries
Query expressions and library implementation
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Please provide a succinct description of the issue.
Array indexing within a an
Expression<'A -> 'B>
is mapped to aGetArray
call (in line with how it works forExpr
?) rather than aget_Item
invocation.There does not appear to be a clean workaround aside from using a
list
or aResizeArray
instead (as theget_Item
mechanism is not exposed).Provide the steps required to reproduce the problem:
Expected behavior
Should generate
System.Linq.Expression.Expression
of the form:Which yields correct SQL:
SELECT VALUE root["u"][0]["c"] FROM root WHERE (root["p"] = "Snapshotted") ORDER BY root["u"][0]["c"] ASC
Actual behavior
NOTE other approaches such as using
query {
run aground for the same fundamental reason (mapping to a surprising F#-specific expression tree)Known workarounds
u: Unfold[]
to be aResizeArray
(or even alist
!)Related information
**C# equivalent (for completeness, yields same
get_Item
invocation)The text was updated successfully, but these errors were encountered: