Repository navigation
symbol_index: resolve fully-qualified constructor calls to the direct_call_shape wall - #8591
Merged
Merged
Conversation
… form for Disj variants qualified_direct_call (ExprMethodCall) and func_sig_from_global_bare both resolve a callee like gunbc.WitnessBin.Run(...) via symbol_index_lookup on the 3-segment dotted name built from the receiver spine plus method name. symbol_index_insert_unique_disj_variant_aliases only ever inserted the 2-segment module_path.variant_name shortcut, and only when that variant name was corpus-wide unique -- so a fully-qualified constructor call never found an entry, fell through qualified_direct_call, and landed on the generic method-call bridge instead of the direct_call_shape_diags wall. The fix adds an unconditional insertion of module_path.TypeName.variant_name ahead of the existing uniqueness-gated 2-segment aliases: it needs no uniqueness check because a variant name is unique within its own Disj and a TypeName is unique within its own module, so the 3-segment key can never collide. This is scoped to constructor calls whose receiver spine root is not a shadowed local (population A per the #8579 census); ordinary local-receiver method calls are unaffected.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Population-A follow-up to #8579's refusal census, opened separately per operator direction (not bundled into #8579).
qualified_direct_call(theExprMethodCallinline gate ininfer_expr_body) andfunc_sig_from_global_bare→borrowed_census_declboth resolve a fully-qualified constructor call likegunbc.WitnessBin.Run(...)viasymbol_index_lookupon the 3-segment dotted name built fromfield_access_spine(recv)+ method name.symbol_index_insert_unique_disj_variant_aliasesonly ever inserted the 2-segmentmodule_path.variant_nameshortcut, and only when that variant name was corpus-wide unique — so a fully-qualified constructor call site never found a symbol-index entry,qualified_direct_callfell through, and the call landed on the generic method-call bridge instead of thedirect_call_shape_diagswall it should have reached.The fix adds an unconditional insertion of
module_path.TypeName.variant_nameahead of the existing uniqueness-gated 2-segment aliases. It needs no corpus-wide uniqueness check: a variant name is unique within its ownDisj, and aTypeNameis unique within its own module, so the 3-segment key can never collide by construction.Applied to both the
.dagauthority (src/v1/04_infer.dag) and its frozen Rust mirror (src/v1/stage0/src/v1_compiler_infer.rs), since the required-regen fold treats drift between the two as a refusal. The mirror hunk (115 lines) is hand-written, not emitter-produced -- a real regen was infeasible in this session (local release build OOM-killed under the shared memory slice; a remote-built binary is linux/amd64 and can't execute in this arm64 container). Its correspondence to what the emitter would produce from the.dagedit is therefore unverified, not stale by intent. It should be regenerated and diffed against this hand-written version the first time a working regen path is available, per the drift-hiding lesson from #8488/#8513.Scope
This closes population A only — qualified-module-path constructor calls whose receiver spine root is not a shadowed local (
spine_root_is_shadowedfalse). Population B (~800 refusals, ordinary local-receiver method calls where the spine root is shadowed) is untouched:spine_root_is_shadowedshort-circuits before any lookup is attempted, and closing it needs a per-method parameter-contract authority that doesn't exist yet. That population is being reported to the operator separately, not fixed here.Receipt
--required-floor, main).witnesses.yml--required-floorstep executes — local execution is currently blocked (a local release build ofclaim_executorwas OOM-killed under the shared session memory slice; a remote-built binary is linux/amd64 and cannot execute in this arm64 session container), so CI's run is both the correctness verification (green-by-execution) and the source of the AFTER count.— sent from stern-tern-636