Commit 6314a3d
committed
Add receiver field to MethodAliasDefinition
Store an optional Receiver on method alias definitions to track how
the alias was invoked: bare `alias_method`, `self.alias_method`, or
the `alias` keyword.
In Ruby, `alias_method` is private on Module, so only the bare form
(implicit receiver) is valid. Aliasing class methods requires entering
the singleton class with `class << self`, which expresses singleton
semantics through lexical nesting, not through a Receiver. This means
valid Ruby aliasing never produces a SelfReceiver, leaving that variant
available for RBS `alias self.x self.y` (singleton aliases).
The SelfReceiver arm currently resolves to instance methods. When RBS
alias support lands, it will resolve to the singleton class instead.
The tests document why that change is safe.1 parent 4eef1c8 commit 6314a3d
File tree
3 files changed
+334
-282
lines changed- rust/rubydex/src
- indexing
- model
3 files changed
+334
-282
lines changed
0 commit comments