Skip to content

fix(air): canonicalize type identities - #489

Merged
akonwi merged 5 commits into
mainfrom
fix/466-canonical-air-types
Sep 8, 2026
Merged

akonwi merged 5 commits into
mainfrom
fix/466-canonical-air-types

Conversation

@akonwi

@akonwi akonwi commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • canonicalize structural AIR types through one child-TypeID-based interner
  • require checker-resolved executable expression types and reserve Void exclusively for Ard's unit type
  • canonicalize nominal declarations, generic applications, foreign named types, and owner-scoped type parameters
  • add explicit nominal reservation/completion/failure lifecycle handling
  • harden AIR validation for duplicate identities, generic relationships, foreign metadata, and generic call type arguments
  • document and accept ADR 0070

Details

This fixes the split identity domain between checker-derived and lowering-synthesized types that allowed one semantic Result<Void, Error> to receive multiple AIR TypeIDs. Constructor validation remains strict; the producer now guarantees canonical identity instead of compensating with structural assignability.

The checker-to-AIR boundary now preserves checked executable types, models non-returning expressions with a checker-only Never type, and rejects unresolved call inference variables. Recursive nominal types use explicit lowerer-owned lifecycle state so incomplete metadata cannot escape finalized AIR.

Testing

  • cd compiler && go test -p 1 ./... -count=1
  • sibling regression checks/builds for tinear, akonwi.github.io, dram, kb, maestro, and migrate
  • sibling test suites for ard-cloudflare, cooper, decode, and ard-sql: 296 tests passed

Fixes #466

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ard-lang-dev Ready Ready Preview Sep 8, 2026 3:24pm UTC

@akonwi
akonwi merged commit a3c2b57 into main Sep 8, 2026
6 checks passed
@akonwi
akonwi deleted the fix/466-canonical-air-types branch September 8, 2026 16:39
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.

Maybe<Result<Void, E>> fails AIR validation during build

1 participant