[regression] Refine order of object convention method pins #1036
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.
The object convention pins currently take priority before all other sources of pins.
This is probably appropriate for the directly defined methods of the class itself, but others methods included by references should come later in the list. This allows a user to call get_method_stack, take the first pin in the list, and use typify() to walk the superclasses and define the correct types.
This behavior also makes resolution of ActiveRecord pins from its RBS collection better today in practice - there are lots of cases where the method pulled in from a reference is auto-generated (say, 'ActiveRecord::Transactions::ClassMethods#after_commit'), but someone has manually overridden the type by defining an RBS method in ActiveRecord::Base.
This created a regression - see https://github.com/castwide/solargraph/actions/runs/17192939145/job/48771022840?pr=892 as an example of what was working before and is not now.