Skip to content

[bug] t27b: a local of an undeclared type in an unreached fn passes, Zig refuses it (hole in the #10897 body rule) #11053

Closed

Description

@gHashTag

Goal

Keep the refusal of a local whose type annotation names a type declared nowhere, in a fn no test reaches. AstGen resolves every name in a body, reached or not; since #10999 body_plan (specs/tri/t27b/lazy_sig_plan.t27) withdraws it as if it were a Sema-level refusal.

Why

Found by the TB2 lane of epic #10879 while building the constant rule (#10899): for

fn f() { var x : Missing = 0; }

with no test calling f, t27b now passes the spec and t27c test-report says BLOCKED ("use of undeclared identifier 'Missing'"). This is a false pass: t27b accepts a spec the reference refuses, and reference_disagree does not count it because the reference does not run it. The t27o corpus (1,130 of 1,216 pass) did not show it; the hole is in the rule, not in a measured spec.

Boundary

  • specs/tri/t27b/lazy_sig_plan.t27
  • gen/rust/tri/t27b/lazy_sig_plan.rs
  • cli/t27b/tests/tail.rs
  • specs/tri/t27b/conformance/lazy_signature.t27

User Scenarios

Requirements

  • FR-001: body_plan MUST keep the refusal of a local annotated with a type declared nowhere in the file.
  • FR-002: The rule MUST live in the plan spec and its tests; the hand Rust in cli/t27b MUST NOT grow (own-language net <= 0).
  • FR-003: A negative control MUST show the spec above refused by t27b and BLOCKED by t27c.

Success Criteria

  • t27b test specs/tri/t27b/lazy_sig_plan.t27 passes with the new tests, and cargo test --release -p t27b passes.
  • The t27o corpus still passes 1,130 of 1,216 specs with 0 reference disagreements.
  • The own-language check reports net <= 0 for the PR.

Activity

  1. added 2 commits that reference this issue on Oct 19, 2026
    0fe198d
    0859ebe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions