Skip to content

t27c: use splice renames a local binding that shares a name with a pulled pub fn #13368

Open

Description

@gHashTag

Observed 2026-11-08 on branch lane/t27l-core (commit 2457ab7). Refs #6092 (open epic: t27c silent misreads to zero). The self-host epic #5980 is closed.

The use splice renames a LOCAL binding whose name equals a pulled pub fn. A call cp_route_name(route), where route is a local binding, was emitted as cp_route_name(t27os_share__route) in generated Zig, because specs/t27os/share.t27 has pub fn route (line 527). Local bindings and parameters must shadow imported names; they must not be renamed. This is a silent misread: it compiles whenever the types happen to fit. Related but distinct: #13256 (a parameter named floor splices libm).

Repro (not run: gen is not run on the bench Mac; the observed instance is named above):

module m
use t27os::share;
pub fn g(route: u32) -> u32 { return cp_route_name(route); }
endmodule

Boundary

  • specs/compiler/use_splice.t27 :: fn rewrite
  • bootstrap/src/use_resolve.rs :: fn resolve

User Scenarios

  • Given a fn with a local binding or parameter named like a pulled pub fn, when the author runs the Zig generator, then the binding keeps its own name in the output.
  • Given a bare call to the pulled pub fn with no shadowing binding, when the author runs the Zig generator, then the call is still renamed to the flat imported name.

Requirements

  • FR-001: rewrite MUST NOT rename an identifier that is bound by a parameter, let or var in the enclosing fn.
  • FR-002: rewrite MUST still rename unshadowed uses of the pulled name.

Success Criteria

  • The generated Zig for the repro contains 0 occurrences of t27os_share__route.
  • A new test in specs/compiler/use_splice.t27 covers the shadowing case and git diff --stat shows 0 other specs changed.

Activity

  1. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Covered by specs/tri/compiler_issues.t27 (typecheck OK, 1 test pass).

  2. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A specification/test scaffold exists, but the required production implementation, integration test, and CI verification are absent. This issue remains open until the target component implements the specified behavior and evidence is provided.

  3. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec exists and passes typecheck + tests. M2 milestone complete.

  4. gHashTag commented on Nov 18, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 spec was created but no production implementation, integration test, or CI verification exists. This issue remains open until the target component implements the specified behavior and evidence is provided.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions