Skip to content

v2 std: import std.types List where it was used unimported (native resolve refusals) - #13048

Merged
gunbai-bot[bot] merged 4 commits into
mainfrom
session/silent-crab-339-list-imports
Oct 3, 2026
Merged

gunbai-bot[bot] merged 4 commits into
mainfrom
session/silent-crab-339-list-imports

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What

Eighteen v2 std modules write List<…> without importing it. Among them are v2.std.node, v2.std.diagnostic, v2.std.qualified_name, v2.std.symbol_index, v2.std.integer and v2.std.inhabitance. This PR adds import std.types { List } to each, following the convention five v2 std modules already use.

Why

The seed tolerates the bare spelling. The v2 resolver does not: List is declared in two modules (std.types and v2.std.collection), so the bare name refuses resolve_reason_unbound_symbol (resolve_unbound_name_is_declared_in_several_modules).

On the native route, each of these modules therefore refuses its own resolve. v2.compiler.name_resolve closure_declarations_demand then drops it from the closure index silently. Every cross-module receiver typed by one of their records refuses as a bare infer_reason_projection_receiver_declaration_unavailable. This was the first wall of the native seven: root.children with root: Node in v2.test.parse.expression_bodied_fn_decl_parse g_tree_has_arrow_body.

v2.std.collection's List cannot be imported here, because v2.std.collection imports v2.std.diagnostic and that would form a cycle. std.types List<element> is also the survivor of the List de-fork in #12526, which deletes v2.std.collection List, so these imports bind the declaration that stays. The explicit imports stay after #12526 lands as well: they are the convention, and DESIGN prefers explicit binding.

Evidence

The cause was named by the typed closure-provider absence built in #13028: resolve_reason_unbound_symbol @ List inside v2.std.diagnostic, chained under the consumer's miss. The native confirmation, which re-runs the focused probe from #13028 with these imports, is reported on #13028.

This PR is independent of N7-1 and is split out at the manager's request (calm-boar-904).

🤖 Generated with Claude Code

…les refused their own native resolve)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brian Searls and others added 2 commits October 3, 2026 03:35
…t import where std.types List was added (10 modules double-bound it), and import it in std.compilers.sugar

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nimported (data_initializer_identity refused its own native resolve)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Rework after the double-binding objection (calm-boar-904). Head is now f2a3e1b19a.

Defect found. The original scan read single-line imports only. Ten modules, not three, already imported List from v2.std.collection in multi-line blocks: cardinality, effect_plan, grammar, integer, native_agreement, orchestration, qualified_name, runtime, timeseries_signal and verdict. They gained a second List binding, which the resolver refuses.

Fixes:

  • 516805a5a2: keep std.types List (the De-fork List: std.types List<element> is the one declaration (v2.std.collection List<T> deleted) #12526 survivor) and drop List from each v2.std.collection import. The import is dropped entirely where it became empty: cardinality, effect_plan, orchestration, qualified_name, timeseries_signal and verdict. std.compilers.sugar, missed because the old scan did not recurse, imports std.types List.
  • f2a3e1b19a: four modules used Optional/Present/Absent unimported, the same class of defect. They now import them from v2.std.optional: data_initializer_identity (one of the 18), semantic_decl_emission, generic_instantiation and operation_realization. None declares its own Present/Absent.

Sweep:

  • No v2 std module binds List twice, and none uses List without a binding. The parser reads multi-line import blocks and recurses into subdirectories.
  • None of the four Optional modules was left using Present/Absent unimported.

Native proof, not the floor:

  • Instrument: a native probe test importing all 15 touched modules, run on N7-1: lambda-binder projection base as lexical reference; dependent-child infer driver types the fold member #13028's head. That head carries v2.compiler.name_resolve's closure-provider refusal roster. A temporary, uncommitted change made the native route surface every refused closure root by module name.
  • Result: none of the 15 refuses. The one refused root in that closure is extdeps.external_authority, which this PR does not touch. It returns bare Present/Absent under the T? sugar, and no dag/extdeps module imports them, so how ? binds in the v2 resolver is a separate, language-level question. It is reported, not fixed here.
  • Why not gunbc test //gunbc/instruments:v2-native-cli: its emitted crate fails to build with 255 rustc errors identically on this PR's base 4aa51b2881 (v2_std_verdict.rs, among others). Those errors are pre-existing, so that instrument cannot resolve anything here.

— sent from silent-crab-339

…g Present/Absent into scope? (extdeps.external_authority refuses its own v2 resolve)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 3, 2026
Merged via the queue into main with commit 776c52f Oct 3, 2026
4 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/silent-crab-339-list-imports branch October 3, 2026 12:23
gunbai-bot Bot pushed a commit that referenced this pull request Oct 3, 2026
R4: each bare use of a name declared elsewhere gets the explicit import of
its single declarer (the #13048 shape). Present/Absent/Optional bind to
v2.std.optional (the T? carrier); std.algebra spells its own FreeMonoid /
FinitelySupportedFunction instead of importing std.types (cycle).
R3: 'none' is the seed's LitNull spelling of Absent; every site sits at an
Optional position, so it is rewritten to Absent with the import.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

0 participants