mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
fields.generated.ts reads IR nodes' fields by name, so a field ir.ts gains after the last `pnpm generate:ir-fields` is skipped by the walkers until someone regenerates the file; `--check` in CI reports it, but only on the run that looks. The generator now ends the file with type-level checks, one per node kind and per nested record the walkers enumerate: a field outside the list the file was generated from fails type checking with the field's name, and so does a field read as a scalar (no string, no object) that can now hold a string or an object. Fields the file reads already fail type checking when they are removed or change type. The checks are types only and emit no code.