GROOVY-8788: STC: prefer closer parameter match over receiver-type match #1768
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.
Given choice between methods
m(String,Object)andm(Object,String), prefer closer parameter matching. This aligns with the method selection of the dynamic compiler/runtime. There is much more discussion of the various test cases in the ticket.With selection of
getAt(Object,String)overgetAt(Map,Object)andputAt(Object,String,Object)overputAt(Map,K,V)there are quite a few STC test issues. Not sure if I should separate them out to a test script just for 8788 or mitigate them with some minor changes or something else. Or if some special STC checks should be added for maps with string keys. I'd be interested to hear how this sits now. @blackdrag @paulk-aserthttps://issues.apache.org/jira/browse/GROOVY-8788
https://issues.apache.org/jira/browse/GROOVY-9420
https://issues.apache.org/jira/browse/GROOVY-9069
https://issues.apache.org/jira/browse/GROOVY-8787
https://issues.apache.org/jira/browse/GROOVY-6970
https://issues.apache.org/jira/browse/GROOVY-6849
https://issues.apache.org/jira/browse/GROOVY-6504
https://issues.apache.org/jira/browse/GROOVY-6131
https://issues.apache.org/jira/browse/GROOVY-5700
#1766 (original incarnation of this idea)