Skip to content

fix(checker): reject private types in public APIs - #342

Merged
akonwi merged 1 commit into
mainfrom
fix/337-private-types-in-public-api
Jul 25, 2026
Merged

fix(checker): reject private types in public APIs#342
akonwi merged 1 commit into
mainfrom
fix/337-private-types-in-public-api

Conversation

@akonwi

@akonwi akonwi commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • validate each module's public interface after checking completes
  • reject private nominal types exposed through fields, signatures, aliases, unions, traits, methods, inferred globals, wrappers, or generic arguments
  • stop at public nominal boundaries so each owning module validates its own declarations
  • add deterministic structured diagnostics and cross-module regression coverage
  • document that public APIs cannot expose private types

Problem

The checker previously accepted public APIs containing private types. Generated Go then failed when another module needed to name the corresponding unexported Go type, so ard check and ard build disagreed.

Migration

Make leaked types public or keep them entirely within private declarations. Dram and Maestro have already been updated to comply with this rule.

Validation

  • cd compiler && go test ./... -count=1
  • cd website && npm run build
  • gopls check on touched Go files; only pre-existing redundant-break hints
  • git diff --check
  • compiler examples check successfully
  • Decode: 9 tests passed
  • SQL: 6 tests passed
  • Migrate: 38 tests passed
  • Tinear: 36 tests passed
  • Dram: 32 tests passed; check and example build passed
  • Maestro: dependencies verified, 46 tests passed, check and build passed

Fixes #337

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
ard-lang-dev Ready Ready Preview, Comment Jul 25, 2026 4:31am

@akonwi
akonwi merged commit e34ca13 into main Jul 25, 2026
6 checks passed
@akonwi
akonwi deleted the fix/337-private-types-in-public-api branch July 25, 2026 04:33
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.

Public struct field with private type passes checking but generated Go cannot name the type

1 participant