Skip to content

Conversation

@apiology
Copy link
Contributor

@apiology apiology commented Aug 23, 2025

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.

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.
@apiology apiology changed the title Refine order of object convention method pins [regression] Refine order of object convention method pins Aug 24, 2025
@castwide
Copy link
Owner

👍 :shipit:

@castwide castwide merged commit 9d80710 into castwide:master Aug 29, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants