Skip to content
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

Fix certain cases where implicit conversions aren't correctly detected when parsing comparison operators #285

Merged
merged 4 commits into from
Aug 15, 2019

Conversation

alexweav
Copy link
Contributor

@alexweav alexweav commented Aug 9, 2019

Hello, all.

I discovered a few edge cases where implicit conversions defined between two types would not be used when parsing comparison operators:

  • The parser only searches for implicit conversions on the type which is being converted, and not the target type. If the conversion is only defined on the target type, it is missed, resulting in a parse failure.
  • The parser doesn't check for implicit conversions at all when parsing equality comparisons on non-value types. If both types are non-value types (e.g. class and string), implicit conversions won't be considered at all.

I added a test which reproduces both cases, as well as fixes for these issues. The test now passes with the fixes for both issues applied.

Please let me know how I can improve the fixes here. Thanks!

@codecov
Copy link

codecov bot commented Aug 9, 2019

Codecov Report

Merging #285 into master will increase coverage by 0.15%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #285      +/-   ##
=========================================
+ Coverage   87.04%   87.2%   +0.15%     
=========================================
  Files          42      42              
  Lines        4260    4266       +6     
=========================================
+ Hits         3708    3720      +12     
+ Misses        552     546       -6
Impacted Files Coverage Δ
...ystem.Linq.Dynamic.Core/Parser/ExpressionParser.cs 86.13% <88.88%> (+0.52%) ⬆️

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 fe440b6...fd11556. Read the comment docs.

Copy link
Collaborator

@StefH StefH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, can you take a look at my comment?

@StefH StefH added the bug label Aug 14, 2019
@alexweav
Copy link
Contributor Author

Hello @StefH, any updates on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants