Skip to content

fix: verify local scalar type aliases without runtime operations - #300

Merged
shanejonas merged 1 commit into
masterfrom
fix/go-local-scalar-aliases
Oct 29, 2026
Merged

shanejonas merged 1 commit into
masterfrom
fix/go-local-scalar-aliases

Conversation

@shanejonas

@shanejonas shanejonas commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Valid Go such as func F(a int32) int32 { type local = int32; var x local = a; return x } currently exports partial evidence and is rejected by native scalar matching. Scalar admission rejects every local type declaration, and the independent CFG verifier rejects the declaration statement.

Admit non-generic aliases whose resolved underlying type is integer or Boolean. The independent source CFG skips type declarations because they add no runtime operation. Keep source inventory, binding/type, value, control and interface verification intact. Distinct local type definitions and other alias kinds remain outside admission.

Validation:

  • The same 12-source alias corpus changes from 12 partial exports to 12 verified exports; all pass the unchanged shared schema. Cases cover zero initialization, Boolean/integer/native widths, grouped aliases, alias chains, shadowing, branches and unused aliases.
  • A hand-written graph checks exactly six runtime/interface nodes and eight value/execution dependencies. Three structurally valid corruptions are rejected; seven unsupported declaration controls remain partial.
  • The existing 22-declaration corpus remains 7 verified / 15 partial, plus two partial closure exports. No broader Go completeness claim.
  • Pinned external compatibility suite: 130/130 checks pass; 24 raw originals pass and 56 corrupt exports are rejected.
  • make check, make quality-gate, make cognitive, repository guard and affected-package go vet pass. The required quality baseline is regenerated; absolute excess counts stay unchanged. Changed-function quality diagnostics are empty.

Trusted-base local risk preflight: UNKNOWN, so this PR needs operator review and is not eligible for automatic merge. It affects four functions, above the current three-function LOW size limit, contains unresolved go/types interface call targets, and adds declarations outside the base analyzer's covered body comparison. No gate or policy changes.

Merge risk: unknown 👀

Code impact: partial 👀
Affected functions: 4.

Dependencies: unchanged ✅

API diff: unchanged ✅

Compared base: 5721714b75c16315462f0053ee646a88da62f669 · head: 6e8e7044b21968a01d81f5bd90df169fd4909796

@shanejonas
shanejonas requested a review from zcstarr as a code owner October 28, 2026 16:10
@shanejonas
shanejonas force-pushed the fix/go-local-scalar-aliases branch from c13a658 to 6e8e704 Compare October 29, 2026 15:27
@shanejonas
shanejonas merged commit fdbeceb into master Oct 29, 2026
16 of 17 checks passed
@shanejonas
shanejonas deleted the fix/go-local-scalar-aliases branch October 29, 2026 15:58
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.

1 participant