Issue #859: Build what ADR-329 and ADR-330 specify: .ty, type parameters, T::kind, match on a kind

Open and answer this issue on GitHub.

language, ready · opened 2026-10-26 · updated 2026-10-31 · 2 comments

History

ADR-329 (.ty, .doc) and ADR-330 (a type passed as a parameter, T::kind, meta::Type) are Accepted, but none of it is built. Found while building json (#604): field.ty is NK1180, a type in a parameter list is a parse error, T::kind with Struct/List/Maybe arms exists nowhere. The only NK1230 case in the compiler is the one from #704 (check_core_expr.nika), not ADR-330 D1’s mechanism. json::write[T], the schema input and read[T] (#604) need these.

Decision

ADR-329, ADR-330, Part II 10.3. Nothing new is decided here; this issue only tracks the build. Whether the ADRs cover everything #604 needs is decided in a later round.

Not specified, so not in this list: building a value of a struct from reflected fields (needed by json::read[T], today field.set is NK1180). That is a separate open decision.

To build

Each step with its tests as .nika in tests/compiler/.

  1. .ty on a reflected field: the field’s type itself (ADR-329 D1, ADR-330 D5), field.ty::kind.
  2. A type as an argument where the parameter list holds one: schema(CreateUser) (ADR-330 D1); a type where a value belongs is NK1230.
  3. T::kind, T::name, T::doc, T::access and meta::Type (Text, List(A), Maybe(A), Map(K,V), Struct(T), Enum(T), Opaque(T), Fn(F)) (ADR-330 D2, D3, D8).
  4. match on a kind: each arm is checked under its kind (ADR-330 D4).
  5. meta::Type only at build time, NK1231 otherwise (ADR-330 D6).
  6. .doc on fields and types (ADR-329 D2).
  7. Named removed from meta::Type, recursion by the type itself (ADR-330 D7).
  8. f[T]() allowed with warning NK1233 (ADR-330 D9; use cases are collected in #514).

The commit that builds the last step says Fixes #N.

Comments

keywan-ghadami, 2026-10-31

Status, 0.0.1317:

Still open: step 2 (a type as an argument, schema(User)), step 8 (parsing f[T]() and narrowing NK1233, ADR-grammar-2 D11), and steps 5–7. #1019 waits on steps 2 and 8.

The build found a lowering defect: #1044.


Generated by Claude Code

keywan-ghadami, 2026-10-31

Status, 0.0.1319:

Gaps the build found:

Still open: steps 5–7.


Generated by Claude Code

Back to Open Issues