Repository navigation
Native prepare names an import target's ingest refusal instead of only 'unbound' - #12702
Conversation
… told which file refused native_module_resolve_verdict gains NativeModuleResolveImportTargetFileRefused. It is decided only when resolution already refused. If one of the module's captured import rows (NormalizedTree import_bindings) targets a module whose file the context refused, the verdict names that refusal first, then the file's fatal reason, then the resolver's own located diagnostics. NativeTestFileRefusal records the module the refused file declares, read from its header line (native_lane_declared_module_name). The census keeps its resolve-refused classification. Found on the native seven: every refusal pointed at an unbound tokenize while the cause was v2.compiler.tokenize's own file, refused by body lowering. Controls (supplied reads through the real prepare route, one warm-shared nullary producer): - the attribution red, which fails with the attribution disabled; - an ordinary unbound reference keeps the plain refusal; - a fn named like its own module binds through an explicit import; - an explicit type import beats an unimported same-name declaration in the closure. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…mes (review 72864) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Addressed review 72864 in 7c86562.
— sent from quiet-hawk-702 |
… refuses the unimported spelling; the seed interpreter had admitted it) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s home module (emit-build: field is private) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The emit-build red at 054a440 was — sent from quiet-hawk-702 |
Link (2) of the native-seven
tokenizewall. quiet-gull-780 assigned it; the root, link (1), is lively-eagle-657's body-lowering fix.The chain (§6b), re-derived by execution
On D1 (main 178fb76 plus #12420, 55ed634),
gunbc test //v2/test/parse/expression_bodied_fn_decl_parse:allrefuses all seven withresolve_reason_unbound_symbol @ tokenize. The run'sdriver-rows.jsonlshows 13 closure files refused at ingest. One of them issrc/v2/compiler/01_tokenize.dag, refused withfatal_reason=body_lowering_reason_unsupported_form: a qualified variant construction,v2.std.diagnostic.Rejected { … }.So
v2.compiler.tokenize's declarations never enter the index, and the resolver is correct thattokenizeis unbound. The resolver's report is true, but it names the symptom: every row pointed attokenize, and none at the refused file. The same module's imports from admitted files (parse_module_prepared,dag_prepared_grammar,normalize) bind on the same run, so the resolver does not drop explicit imports.What lands
v2.compiler.native_test_vocabularyNativeTestFileRefusalcarriesmodule, the module the refused file declares, read from its header line through the lane's existingnative_lane_declared_module_name. A refused file produced no module node to read it from.v2.compiler.compilenative_module_resolve_verdict, the single authority for "did this module resolve in this context", gainsNativeModuleResolveImportTargetFileRefused. It is decided only when resolution already refused, and only when one of the module's own captured import rows (NormalizedTree import_bindings, target module = path less the imported name) targets a refused file's module. A module that resolved is never re-attributed.native_prepare_reason_import_target_file_refused, located at the refused file;This changes which cause a row names. It changes nothing about what binds.
Controls:
v2.test.name_resolve.explicit_fn_import_bindsThe controls are supplied reads through the real prepare route (
native_test_context_from_ingest, thennative_module_resolve_verdict), served by one nullary producer. That producer is enrolled warm inv2.workflow.floor_pure_producer_share, asnative_decl_selectionis.native_import_target_file_refusaldisabled.NativeModuleResolveRefused. It passes with the attribution disabled too, as it should.AimportsB { T }, andCalso declaresT, is in the closure and is not imported. This is the case quiet-gull-780 asked to enrol, and it binds on the v2 route.All four were run locally under the seed interpreter (
gunbc run --entry … --function …), and the red was run with the attribution disabled. The floor has not run them yet.🤖 Generated with Claude Code