Skip to content

feat(checker): unify generic call inference - #336

Merged
akonwi merged 2 commits into
mainfrom
feat/325-generic-call-inference
Jul 24, 2026
Merged

feat(checker): unify generic call inference#336
akonwi merged 2 commits into
mainfrom
feat/325-generic-call-inference

Conversation

@akonwi

@akonwi akonwi commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • adopt ADR 0055 and consolidate Ard generic calls around fresh, call-local inference variables
  • apply receiver and explicit bindings before checking arguments, then reconcile argument, parameter, and expected-return constraints deterministically
  • support nested contextual inference while preserving independently generic higher-order calls such as decoder combinators
  • reject unresolved call-owned generics before AIR, including forward calls, function values, builtin constructors, and nested shapes
  • preserve source-order refinement for named arguments and improve conflict diagnostics with establishing-source labels
  • complete generic traversal for functions, collections, channels, references, nominal applications, and foreign types
  • lower explicit generic Go calls using concrete AIR argument types so conversions and empty collections remain correctly typed

Validation

  • cd compiler && go test ./... -count=1
  • Decode: 9 passed
  • Tinear: 36 passed
  • SQL: 6 passed
  • Maestro server: 46 passed

Performance exploration

Warm ard check comparisons against the pre-change commit were effectively neutral on real projects:

  • Decode: +0.6%
  • Tinear: +0.5%
  • Maestro: -1.2%

An intentionally generic-heavy synthetic file with 6,000 calls increased from 24.9 ms to 36.4 ms (+46%, about 1.9 µs per generic call). This change prioritizes correctness; the synthetic result provides a follow-up optimization data point.

Fixes #325

@vercel

vercel Bot commented Jul 24, 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 24, 2026 3:15am

@akonwi
akonwi merged commit 2510230 into main Jul 24, 2026
6 checks passed
@akonwi
akonwi deleted the feat/325-generic-call-inference branch July 24, 2026 03:17
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.

Unify generic call inference into a single constraint pipeline

1 participant