Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inference issues around convert to object #21125
Fix inference issues around convert to object #21125
Changes from 2 commits
f1357da
2e3a0e2
f2a82e3
4386a20
40f26ff
9f107a4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to move this to local function? This is not specific to BinaryExpression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't used anywhere else so I did it... We can always move it out if it's needed no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we need to remember that we had method like this hiding here.
Local methods which are valid in a context of a particular method makes sense but not used elsewhere hence local could be bit non-productive.
cc: @dotnet/efcore ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to bother everyone, I'll just move it out if that's what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a usecase, there RemoveObjectConvert in VisitMethodCall too. You can DRY with TryUnwrapConvertToObject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In VisitBinary we need to know if we unwrapped or not (hence Try*), but in VisitMethodCall we don't (so it returns the unwrapped)... So DRYing would make VisitMethodCall clunkier (calling Try* and testing the result). Let's leave things the way they are, the code fragment is really small...
However I did DRY out RemoveObjectConvert in Relational which is used by both VisitMethodCall and ConvertObjectArrayEqualityComparison.