mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-23 22:06:04 +00:00
`self$m()` inside an R6 method resolved by the shared lexical walk, because `self` had no type binding. An inherited method got no edge, and a top-level function of the same name was bound instead (0.49), as was one for a method that no class in the chain defines. emitRScopeCaptures now types `self` in each R6 method (a function in the public, private or active list of an R6Class call assigned to a name, bare or R6::) as that class, through a synthetic @type-binding.self capture that interpretRTypeBinding reads with the shared `self` source. The shared receiver pass then resolves the call through the class and its MRO at the receiver-call confidence (0.85). Where self is no R6 instance (a free function, a parameter named self, an R6Class call that is assigned to nothing, a RefClass method) the module and the outermost function frames own `self` untyped (scopeOwnsReceivers), so the call is suppressed as receiver-owned-but-unbound instead of reaching a free function. A file that binds `self` at top level is exempt, so a global `self <- Foo$new()` still types its free functions' calls. For a typed self whose class and parents lack the method, resolveReceiverMember answers an empty ambiguous lookup, which stops the lexical fallback (outcome member-lookup-ambiguous; no shared code is touched). A class name containing a dot keeps the generic route: the shared pass reads it as qualified. Documented in docs/languages/r-provider.md. Tests: new r-self-binding fixture and test (c1-c13), r-call-shapes pins re-measured, two rename fixtures (a free function sharing a name with an R6 method called through self). |
||
|---|---|---|
| .. | ||
| languages | ||
| plans | ||
| cli-reference.md | ||
| deployment.md | ||
| editor-setup.md | ||
| mcp-reference.md | ||
| wiki-generation.md | ||