GitNexus/docs/languages
Mick Cooney 1c65b99753 fix(r): bind R6 self to its enclosing class
`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).
2026-10-24 12:27:34 +01:00
..
c-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
cobol-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
cpp-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
csharp-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
dart-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
go-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
java-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
javascript-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
jupyter-notebook.md feat: index Jupyter notebooks as Python (#3381) 2026-09-27 05:54:37 +00:00
kotlin-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
local-import-scoping.md fix(r): keep qualified calls and library() inside the package namespace 2026-10-24 12:00:46 +01:00
objective-c-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
objective-c-provider.md feat(indexing): add Objective-C semantic indexing support (#3179) 2026-09-09 09:40:21 +00:00
php-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
python-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
r-provider.md fix(r): bind R6 self to its enclosing class 2026-10-24 12:27:34 +01:00
README.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
receiver-resolution-audit.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
ruby-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
rust-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
swift-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
typescript-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
vue-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00
zig-ingestion-gaps.md docs: simplify guides and verify receiver gaps (#3694) 2026-10-23 09:06:03 +01:00

Language Ingestion Gap Inventories

These inventories are the starting point for language-specific plans. There is one <language>-ingestion-gaps.md file for each of the 18 languages in SCOPE_RESOLVERS. Names match provider directories; jvm is shared infrastructure, not another language.

Freshly audited on 2026-10-23 with production sources at c35806d24 and the accompanying benchmark changes. The measurement receipt records the commands, exact-target checks, newly executed exclusions and test limits. The baseline now covers 110 executable cases and 58 explicit N/A declarations. Parsing, imports, visibility, inheritance and incremental behavior still need separate evidence; these fixed receiver examples do not establish whole-language, CFG/PDG or rename completeness.

Inventories

Language First planning candidate
C Reproduce header ownership separately from pointer dispatch.
COBOL Measure procedure-pointer and structural-call paths separately.
C++ Substitute explicit template arguments into proven return types.
C# Trace typed array receivers and qualified nullable fields.
Dart Correct awaited-call ownership; trace indexed and generic receivers.
Go Expand ownership coverage beyond the passing receiver matrix.
Java Trace array-element receiver typing.
JavaScript Preserve JSDoc container evidence for indexed receivers.
Kotlin Inventory companion and inherited-receiver limits.
Objective-C Add receiver measurements without weakening dynamic-dispatch boundaries.
PHP Retain PHPDoc container types and establish namespace owners.
Python Audit constructor-field and module ownership coverage.
Ruby Isolate YARD parameter bindings before adding recall.
Rust Measure conservative smart-pointer limits before widening them.
Swift Type indexed receivers, then revalidate historical reports.
TypeScript Revalidate deferred narrowing contracts.
Vue Type indexed receivers in SFC script blocks.
Zig Add matrix coverage for the delivered receiver forms.

Reading the evidence

Label Meaning
Measured gap A checked-in receiver cell lacks its call edge. Reproduce on the chosen base before fixing it.
Recorded gap / boundary The baseline notes, source contract or dedicated tests describe a limitation; it may be outside the shape matrix.
Negative control / deliberate limit An unresolved result protects precision. Do not make it resolve without new evidence of the exact target.
Coverage gap / audit A measurement is absent or coverage needs inventory. This does not establish a product bug.
Historical reports Older claims still need current positive and negative reproductions.

The receiver harness has separate states:

  • RESOLVES: the terminal call reaches its full expected declaration ID, with no same-named edge to a different owner. This proves only the supplied fixture.
  • WRONG-TARGET: at least one same-named call reaches another declaration, including any guessed edge from an untyped control.
  • VISIBLE-GAP: no matching edge, with a recorded receiver-unresolved drop. Some cells intentionally represent untyped negative controls.
  • INVISIBLE-GAP: neither the edge nor the receiver drop is recorded; drop counts cannot reveal this loss.
  • N/A: the harness declares this spelling inapplicable to its measurement. Read its reason before interpreting language support.
  • GRAMMAR-UNAVAILABLE: the parser did not load. No behavior was measured; this is not a product-gap verdict.

An all-N/A row (C or COBOL) does not mean complete ingestion. Vue now has an executable SFC row. Zig and Objective-C have dedicated tests but no row in this shape arm. A fully resolving row also proves only its fixed examples. The baseline's count arm includes external and unknown receivers, so total drops are not an actionable bug count.

Turning an inventory into a plan

  1. Select a stable gap ID and pin the implementation base. Record a minimal source example, expected full target identity, observed edge/drop and relevant tests.
  2. Add a meaningful negative: a same-name decoy, unknown type, shadowed import or ambiguous owner. Keep intentional untyped controls unresolved.
  3. Locate the missing fact: parsing/capture, type extraction, declaration ownership, import binding, receiver folding or dispatch. Keep language rules in providers and shared resolution algorithms language-agnostic.
  4. Write the plan under docs/plans/, linking back to the gap ID. Define the smallest contract change, affected tests and corpus/benchmark comparisons. Follow the repository's impact-analysis and pre-commit change-analysis requirements.
  5. Run focused regressions and the receiver check before updating expectations. The harness documents build and cache requirements. Record grammar skips and measurement limits explicitly.
  6. Update the inventory with the merged PR, verified source revision and evidence. Close the specific item without marking the whole language complete.

Keep historical reports separate from measured gaps. When adding a registered language, add its inventory here; when refreshing a snapshot, update its source pin and explain intended baseline changes. Do not copy old green results as fresh runs.