fix(cpp): thread call-site types into qualified member lookup (#1632)#1810
Conversation
…anpatwari#1632) Widen Callsite (arity optional, add argumentTypes) and add optional callsite?: Callsite to ScopeResolver.resolveQualifiedReceiverMember. receiver-bound-calls.ts passes the ReferenceSite through structurally; resolveCppQualifiedNamespaceMember forwards it to narrowOverloadCandidates along with cppConversionRank, enabling exact-type and conversion-rank disambiguation across inline-namespace children. Behavior change: - outer::foo(42) where v1 declares foo(int) and v2 declares foo(double) now resolves to v1::foo (was: 0 edges, conservatively suppressed). - Same-name same-normalized-signature (e.g. foo(int) vs foo(long)) still suppresses at 0 edges via isOverloadAmbiguousAfterNormalization. - ADL using-import path (resolveAdlCandidates) unchanged — passes no callsite, narrowing degrades to existing pass-through behavior. Closes abhigyanpatwari#1632. Part of abhigyanpatwari#1564.
|
@prajapatisparsh is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
Claude finished @magyargergo's task in 6m 37s —— View job PR #1810 Review — C++ inline namespace call-site types
Review barPer Current PR stateBranch: Could not run Understanding of the changeThe full runtime path for
For For FindingsFinding 1 — Stale
|
|
@prajapatisparsh could you please look into claude's findings? |
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 9708 tests passed 2 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
…ari#1632 - Remove stale expected-failure entry for old diff-sigs test name (test now expects 1 edge; legacy DAG also emits 1 edge) - Add entry for normalized-signature ambiguity (int vs long) test - Rename describe block from 'conservative suppress' to 'distinct signatures resolved via call-site types' Verified both modes: REGISTRY_PRIMARY_CPP=1: 241/241 passed REGISTRY_PRIMARY_CPP=0: 194 passed, 47 skipped, 0 failed
| }, 60000); | ||
|
|
||
| it('outer::foo(42) emits zero CALLS edges when v1 declares foo(int) and v2 declares foo(double)', () => { | ||
| it('outer::foo(42) emits exactly 1 CALLS edge to v1::foo(int) when v1 declares foo(int) and v2 declares foo(double)', () => { |
|
Thank you! Feel free to pickup more :) |
Sure |
Summary
Closes #1632. Part of #1564 (LANG-cpp).
Thread call-site arity and argument types through the
resolveQualifiedReceiverMembercontract sonarrowOverloadCandidatescan disambiguate inline-namespace children with distinct signatures (e.g.foo(int)vsfoo(double)).Changes
gitnexus-shared/.../types.ts— WidenedCallsite:aritymade optional,argumentTypesaddedscope-resolution/contract/scope-resolver.ts— Added optionalcallsite?: CallsitetoresolveQualifiedReceiverMemberreceiver-bound-calls.ts— Passessite(ReferenceSite) through structural typinglanguages/cpp/scope-resolver.ts— Forwardscallsitein the lambdalanguages/cpp/inline-namespaces.ts— Acceptscallsite?, importscppConversionRank, threads both intonarrowOverloadCandidatestest/integration/resolvers/cpp.test.ts— Flippedfoo(int)vsfoo(double)fixture from 0→1 edge (verified bystartLine: 4for v1::foo), added normalization-ambiguity fixture (intvslong, stays at 0 edges)test/fixtures/.../cpp-inline-namespace-ambiguous-normalized/— New fixtureBehavior
outer::foo(42)— v1 hasfoo(int), v2 hasfoo(double)outer::foo()— identical sigs in both childrenouter::foo(42)—foo(int)vsfoo(long)(normalize to same type)Testing
Notes
conversionRankFnis imported directly ininline-namespaces.ts(not threaded through the contract) — keeps the contract language-agnostic.