Draft
Conversation
46c92f3 to
ed0c757
Compare
786d5bd to
9a87116
Compare
0eaade9 to
237b806
Compare
237b806 to
b647e6f
Compare
7bd16e0 to
331d5d5
Compare
d7ac787 to
eeb8264
Compare
d7ac787 to
eeb8264
Compare
9db7fbd to
aca2ce0
Compare
b4dd418 to
3e14fec
Compare
3e14fec to
6a0ac3a
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I was investigating a type inference performance issue on
tayu0110/exml, and came up with a small reproduction case (first commit), which revealed that we are not correctly handling resolution of calls to non-method associated functions when the argument used to resolve the call has multiple trait bounds.For method calls we are handling multiple trait bounds correctly since #21043, so the obvious solution would be to replicate this logic for non-method calls as well.
However, with #21217 we have:
which allows us to instead unify the resolution logic for calls to methods (module
MethodResolution) and calls to non-methods (moduleNonMethodResolution) in a single implementation encompassing calls to all associated functions (moduleAssocFunctionResolution). Calls to non-associated functions does not rely on type inference (but instead on path resolution only), which is handled in the classNonAssocCallExpr.Just like we can unify call resolution logic, we can also unify propagation of type information for resolved calls for calls to methods (module
MethodCallMatching) and calls to non-methods (moduleNonMethodCallMatching) in a single implementation (moduleFunctionCallMatching), and type inference for tuple-like variant and struct constructions such asOption::Some(42)is then done in a separate moduleTupleLikeConstructionMatching.LOC removed