You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When re-inferring a binary operator in nullable walker, we previously replaced the original containing type with a new one if there was any implicit conversion between them, so e.g. operator==(ROS, ROS) would be re-inferred as a member of Span because there is a conversion from Span to ROS. But that doesn't mean the operator can be found on Span! Instead we should only allow conversions that make sense so the operator can be actually found on the re-inferred parent, e.g., a derived relationship (implicit reference conversion).
1. It looks like modified method affects only binary operators, not any methods
I think it does affect only binary operators though - the modified code is inside ReInferBinaryOperator.
2. It is not clear what conversion specifically. Between which types, etc.
I can update the title to say between derived/base types I guess. Thanks.
The description also doesn't clearly describe the context for the change, in my opinion. Consider adjusting.
I'm not sure what you mean, can you elaborate?
jjonescz
changed the title
Narrow conversion kinds considered when reinferring methods by nullable walker
Consider only base/derived type conversion kinds when reinferring methods by nullable walker
Sep 16, 2025
It looks like modified method affects only binary operators, not any methods
I think it does affect only binary operators though - the modified code is inside ReInferBinaryOperator.
Ah, that's what you are saying. Sorry, I misread it. I will update the title.
jjonescz
changed the title
Consider only base/derived type conversion kinds when reinferring methods by nullable walker
Consider only base/derived type conversion kinds when re-inferring binary operators by nullable walker
Sep 16, 2025
jjonescz
changed the title
Consider only base/derived type conversion kinds when re-inferring binary operators by nullable walker
Improve a check for inheritance relationship between types during binary operator re-inference in nullable walker
Sep 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
When re-inferring a binary operator in nullable walker, we previously replaced the original containing type with a new one if there was any implicit conversion between them, so e.g.
operator==(ROS, ROS)would be re-inferred as a member ofSpanbecause there is a conversion fromSpantoROS. But that doesn't mean the operator can be found onSpan! Instead we should only allow conversions that make sense so the operator can be actually found on the re-inferred parent, e.g., a derived relationship (implicit reference conversion).Fixes #80255.