Skip to content

test(resolution): calls on nested receivers keep their evidence and guess no target - #2867

Merged
colbymchenry merged 1 commit into
mainfrom
claude/pr-1844-nested-receiver-evidence
Oct 23, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
claude/pr-1844-nested-receiver-evidence

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

Test-only. A regression test for member calls on nested receivers, like holder?.values.get(readKey()), in .ts, .tsx, .js and .jsx. Such calls have failed both ways:

What the test checks

Eight receiver shapes: optional access, a computed key, a numeric index, a quoted key, a comment inside the receiver, a non-ASCII name, an imported root and a namespace import. For each one it checks:

  • the readKey() argument call survives;
  • nothing links to Collision.get or to the imported object;
  • the three dotted chains (holder.values.get, imported.values.get, data.holder.values.get) are still in the index as unresolved references.

What came from the contributor, and what we changed

The test is @bompus's commit, with one addition of ours: the third check, 7 lines. As first written, the test passed on #1790's commit de5adba7, with the kernel and with CODEGRAPH_KERNEL=0. So it could not see the drop that #1794 is about. It only caught the bare-name guesses from before #1790. We squashed it into one commit with their authorship and our message.

The non-ASCII name höldér uses U+00F6 and U+00E9. These are Latin-1 letters, not homoglyphs. The diff has no invisible or bidi characters.

Validation

The 4 cases (ts, tsx, js, jsx), with the kernel (CODEGRAPH_KERNEL_EXPECT=1) and with CODEGRAPH_KERNEL=0:

commit as first written with our check
72c1ff13, #1790's parent 4 failed, both engines: every shape linked Collision::get 4 failed, both engines
de5adba7, #1790 4 passed, both engines 4 failed, both engines: expected [] to deeply equal [ 'holder.values.get' ]
main d02a88d0 4 passed, both engines 4 passed, both engines

Mutations of main's TS extractor (CODEGRAPH_KERNEL=0):

mutation this test as first written this test with our check #1566 Map test release-main-regressions retention test
put #1790's drop back passes fails 4/4 passes fails
shapes the chain pattern rejects fall back to the bare method name fails 4/4 fails 4/4 passes passes

So the second mutation is caught by this test alone.

Suite: __tests__/resolution.test.ts on the exact commit, 240 of 240 passed with the kernel. The new cases also pass with CODEGRAPH_KERNEL=0. Test-only, so no CHANGELOG entry.

Lands #1844 by @bompus.

🤖 Generated with Claude Code

…uess no target

A member call on a nested receiver, like holder?.values.get(readKey()),
has failed both ways. Before PR #1790, each such call was linked by its
bare method name, to any project method called get. PR #1790 stopped
that by dropping every call on a chain rooted at a name, which also
dropped the call sites effects are drawn from (issue #1794). PR #1862
brought the dotted chains back as unresolved references; shapes its
chain pattern rejects, like holder[0].get(), are still dropped.

The test indexes eight receiver shapes in .ts, .tsx, .js and .jsx:
optional access, computed and numeric keys, a quoted key, a comment
inside the receiver, a non-ASCII name, an imported root and a namespace
import. It checks that the readKey() argument call survives, that
nothing links to Collision.get or to the imported object, and that the
three dotted chains (holder.values.get, imported.values.get and
data.holder.values.get) are still in the index, unresolved.

That last check is ours. As first written, the test passed on PR
1790's commit de5adba, so it could not see the drop issue 1794 is
about. With it, the test fails 4 of 4 on de5adba (the chains are
gone) and 4 of 4 on its parent 72c1ff1 (every shape linked
Collision::get), with the kernel and with CODEGRAPH_KERNEL=0, and
passes 4 of 4 on main d02a88d with both. On main's code, putting the
drop back fails it, as it fails release-main-regressions' retention
test; letting the shapes the chain pattern rejects fall back to the
bare method name fails only this test. The non-ASCII name is written
with U+00F6 and U+00E9, Latin-1 letters, not homoglyphs. Test-only, so
no CHANGELOG entry.

Original PR #1844 by @bompus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@colbymchenry
colbymchenry merged commit 3750921 into main Oct 23, 2026
@colbymchenry
colbymchenry deleted the claude/pr-1844-nested-receiver-evidence branch October 23, 2026 21:06
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.

2 participants