Skip to content

Fixed crash in sort lambda from generic resource definition #1162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

bkoelman
Copy link
Member

Fixed crash when a generic resource definition references an interface field from its OnApplySort lambda. Where we used to special-case for Identifiable.Id, we now always use the expression type for resource graph lookups. This is safe because its not possible in C# to remove base members. The value of memberExpression.Expression is null on static member access, which is unlikely to occur in sort lambdas.

Closes #1161. See the linked issue for bug repro.

QUALITY CHECKLIST

…e field from its OnApplySort lambda. Where we used to special-case for Identifiable.Id, we now always use the expression type for resource graph lookups. This is safe because its not possible in C# to remove base members. The value of memberExpression.Expression is null on static member access, which is unlikely to occur in sort lambdas.
@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #1162 (8c76876) into master (9af5eda) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 8c76876 differs from pull request most recent head 174a599. Consider uploading reports for the commit 174a599 to get more accurate results

@@            Coverage Diff             @@
##           master    #1162      +/-   ##
==========================================
- Coverage   92.58%   92.58%   -0.01%     
==========================================
  Files         241      241              
  Lines        7702     7700       -2     
==========================================
- Hits         7131     7129       -2     
  Misses        571      571              
Impacted Files Coverage Δ
...NetCore/Resources/SortExpressionLambdaConverter.cs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9af5eda...174a599. Read the comment docs.

@bkoelman bkoelman merged commit 84106ac into master Jun 24, 2022
@bkoelman bkoelman deleted the fix-definition-sort-in-type-hierarchy branch June 24, 2022 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Sorting by an interface member from a lambda expression fails
1 participant