Skip to content

v1 infer: a qualified function name in value position is typed by its arrow, not its return (#12143 exposure) - #12231

Merged
gunbai-bot[bot] merged 2 commits into
mainfrom
session/still-seal-357-seed-qualified-fn-value
Sep 24, 2026
Merged

gunbai-bot[bot] merged 2 commits into
mainfrom
session/still-seal-357-seed-qualified-fn-value

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

The fifth claim red on unmodified main, found during adhoc-9d86ad93-96c (companion to gunbc#12230, split out at neat-boar-16's direction because this is a seed change).

Defect (a regression on main, exposed by #12143)

v1.compiler.infer qualified_value_projection typed a qualified function name in value position by the declaration's inferred, and for a function declaration that is its return type. So pred: v2.lens.complexity_accumulator_copy.analyze.finding_is_suspect was typed Bool. Before #12143, function-typed arguments were never judged, so this was harmless. After #12143 it refused a correct program: roster_gate.dag expected Node(fn), got Coproduct(Bool), which reddened v2.test.long… live_read_classification unit_closure_is_local_read and blocks #12202's floor. The bare spelling of the same reference was accepted, because the bare arm already types a function value with resolved_callable_type.

Repair, at the owning link

qualified_function_value_type: for a ModuleItemFunction declaration, the qualified arm makes the bare arm's judgment, typing the name by its arrow (resolved_callable_type(params, return)). It uses the same nullary rule: a nullary function where no arrow is expected keeps its existing reading. expected is threaded into qualified_or_service_projection. Qualified calls are unaffected: they route ExprMethodCall → dotted ExprCall, not through this projection.

Evidence (srv1, neat-boar-16)

  • New cells in dag/test/claim/infer_function_value_argument_arrow_witness_test.dag (required prefix test.claim.infer_):
    • qualified_matching_accepted is the discriminating red: FAIL before the change, PASS after.
    • qualified_mismatched_parameter_refuses is the control that a qualified function value is still judged: PASS before and after.
  • unit_closure_is_local_read: refused on roster_gate:162/163/247 before the change, PASS after.
  • The stage0 mirror was regenerated, never hand-edited. The first regen drifted v1_compiler_infer.rs and v1_compiler_emit.rs; the second exited 0 at a byte-identical fixed point. The v1_compiler_emit.rs hunk (one removed pub use crate::v1_compiler_infer_items::item_resource_names;) is authority-derived drift that main already carried, not part of this change's semantics.

v1 purpose test: admitted, because it unblocks v2 claims and #12202's floor.

🤖 Generated with Claude Code

Brian Searls and others added 2 commits September 24, 2026 14:26
… arrow, not its return

qualified_value_projection read a function declaration's inferred (its RETURN) as the value's
type, so pred: m.analyze.finding_is_suspect was typed Bool; after #12143 began judging
function-typed arguments that refused a correct program (roster_gate.dag, reddening
v2.test.claim.long.live_read_classification unit_closure_is_local_read). The qualified arm now
makes the bare arm's judgment (resolved_callable_type, same nullary rule). Stage0 mirror to be
regenerated by --required-regen.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
required-regen drifted v1_compiler_infer.rs and v1_compiler_emit.rs after
the 04_infer.dag change. Installed the candidate, rebuilt, and a second
regen round exited 0 with every candidate byte-equal (fixed point).
Before the regen, qualified_matching_accepted failed and
unit_closure_is_local_read refused on roster_gate; after it, both pass,
and qualified_mismatched_parameter_refuses passes throughout.

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 Sep 24, 2026
Merged via the queue into main with commit da5a327 Sep 24, 2026
5 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/still-seal-357-seed-qualified-fn-value branch September 24, 2026 18:36
gunbai-bot Bot pushed a commit that referenced this pull request Sep 24, 2026
… projection + the callees_from_decl rename
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