Skip to content

Fix typed method receiver parsing and dispatch#97

Merged
luisleo526 merged 1 commit into
mainfrom
codex/ki73-method-receiver-types-20260721
Jul 21, 2026
Merged

Fix typed method receiver parsing and dispatch#97
luisleo526 merged 1 commit into
mainfrom
codex/ki73-method-receiver-types-20260721

Conversation

@luisleo526

Copy link
Copy Markdown
Contributor

What changed

  • parse the complete Pine type-hint grammar for method receivers, including primitive and generic collection types
  • key authored methods by their exact structured receiver type throughout analysis, return inference, and code generation
  • resolve exact typed user methods before same-named collection or drawing builtins
  • preserve receiver-family pass behavior, history-Series boundaries, default/keyword arguments, and source-order evaluation
  • add direct parser, dispatch, builtin-collision, pass-mode, and recovery-fence coverage

Root cause

_parse_method_def consumed the receiver type as a bare IDENT. Primitive receiver tokens and generic type arguments therefore triggered top-level parser recovery, silently removing an otherwise valid method declaration from the AST.

An ordinary later call then failed during C++ generation. More dangerously, a dropped method such as method push(array<int> self, ...) allowed values.push(...) to compile through the builtin push_back path, executing the wrong body while appearing successful.

Validation

  • public-base reproduction: recovery count 1 and zero MethodDef; array collision emits builtin push_back
  • candidate reproduction: recovery count 0 and one MethodDef; authored typed method dispatches
  • focused receiver and stable-recovery suite: 68 passed
  • full explicit-corpus pytest: exit 0, 2,476 tests collected
  • compileall, git diff --check, and manual float/bool/string receiver transpile+compile: pass
  • 252 engine-corpus generated outputs byte-identical to base
  • 411 successful scraper-source outputs byte-identical, with the same five established rejections and zero status differences
  • candidate-aware engine corpus: 252/252, 247 Excellent / 4 Strong / 1 documented anomaly; report regeneration and lock-step self-test pass
  • forced-no-cache scraper gate: 416/416 classified using a bounded 2 outer x 4 inner worker topology; zero compile errors, zero driver errors, zero unresolved timeouts, and 0 UP / 0 DOWN tier moves

Scope boundary

This PR does not change verifier, tier, TradingView evidence, strategy inputs, or engine runtime semantics. A separately observed single-expression matrix-method return void issue remains outside this fix.

@luisleo526
luisleo526 merged commit dc7a87b into main Jul 21, 2026
9 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.

1 participant