Skip to content

Support extend#462

Open
sinsoku wants to merge 1 commit into
ruby:masterfrom
sinsoku:support-extend-resolution
Open

Support extend#462
sinsoku wants to merge 1 commit into
ruby:masterfrom
sinsoku:support-extend-resolution

Conversation

@sinsoku

@sinsoku sinsoku commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

TypeProf did not handle extend, so methods added via extend M were reported as "undefined method" and extend was missing from the dumped RBS.

Implement it symmetrically to include: parse Ruby/RBS extend, resolve the extended module's instance methods as the receiver's singleton methods, and dump extend for class bodies (like include).

Self-referential extend (e.g. extend self) is still unsupported.

TypeProf did not handle `extend`, so methods added via `extend M`
were reported as "undefined method" and `extend` was missing from
the dumped RBS.

Implement it symmetrically to `include`: parse Ruby/RBS `extend`,
resolve the extended module's instance methods as the receiver's
singleton methods, and dump `extend` for class bodies (like
`include`).

Self-referential `extend` (e.g. `extend self`) is still unsupported.
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.

1 participant