Skip to content

fix(typecheck): ?T is an optional and accepts its payload - #6187

Merged
gHashTag merged 2 commits into
masterfrom
claude/t27b-optional-coerce
Oct 4, 2026
Merged

gHashTag merged 2 commits into
masterfrom
claude/t27b-optional-coerce

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Closes #6186
Refs #6063

What

  • resolve_type_str resolves Zig's prefix optional ?T (it only knew the suffix T?; ?u32 became Custom("?u32")).
  • types_compatible: an Optional(T) target accepts T and ?T under the payload's own rules. Cross-sign and narrowing stay rejected.
  • Unit test optional_accepts_its_payload_6186; FROZEN_HASH resealed (sha256 of compiler.rs).

Evidence

  • Against a t27c built from exact origin/master, over the 31 specs using ?T: 3 verdicts changed, all removals of false diagnostics -- specs/pins/parser.t27 FAILED -> OK, specs/port/scripts/gen_w378.t27 FAILED -> OK, queen-public-leaderboard.t27 8 -> 7 warnings.
  • Local t27c suite --ratchet --corpus-only: UNEXPECTED PASS for exactly those two specs, 0 unexpected failures. Both ledger entries removed, max_entries 113 -> 111.
  • t27b: gen_w378 was the lab's one LAB-FRONTEND-DISAGREES spec; it now reaches a real codegen blocker (string literal).

🤖 Generated with Claude Code

resolve_type_str only knew the suffix spelling `T?`, so Zig's prefix
`?T` resolved to Custom("?u32") and `opt = value` with `value: u32`
was a false type mismatch. types_compatible now lets Optional(T)
accept T (and ?T) under the payload's own rules; cross-sign and
narrowing stay rejected.

Corpus ratchet: specs/pins/parser.t27 and
specs/port/scripts/gen_w378.t27 are UNEXPECTED PASS and nothing else
moved, so both ledger entries go and max_entries follows, 113 -> 111.
FROZEN_HASH resealed because compiler.rs changed (sha256 of the file).

Closes #6186
Refs #6063

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 16:39:05 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 45
PRs with All Checks Green 5
READY 4
FAILING 45
PENDING 0
NO CHECKS YET 0

These columns do not partition: 4 + 45 + 0 + 0 = 49, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8597b6ded596 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 16:47:58 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 44
PRs with All Checks Green 6
READY 4
FAILING 44
PENDING 0
NO CHECKS YET 0

These columns do not partition: 4 + 44 + 0 + 0 = 48, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8597b6ded596 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit f033b20 into master Oct 4, 2026
33 of 35 checks passed
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.

t27b frontend: assigning i32 to ?i32 is rejected; the reference passes it (gen_w378.t27)

1 participant