Tya v0.56 Release Notes

Status: shipped. tya version reports 0.56.0 and ROADMAP.md carries the matching Released entry.

TL;DR

v0.56 finishes the diagnostics pipeline work started in v0.54:

The language surface is unchanged from v0.55.

What’s new

Signature unification

// Parser
prog, diags, err := parser.Parse(toks)
prog, diags, err := parser.ParseWithComments(toks, comments)

// Codegen
csrc, diags, err := codegen.EmitC(prog)
csrc, diags, err := codegen.EmitCWithPath(prog, sourcePath)
csrc, reg, diags, err := codegen.EmitCWithCoverage(prog, sourcePath, opt)

// Runner
diags, err := runner.RunFile(path, stdin, stdout, args)

The diags slice is nil (and err == nil) on a clean run, and carries one or more diag.Diagnostic entries otherwise. The *ParserError / *CodegenError / *RunnerError wrappers continue to satisfy errors.As for callers that don’t want to migrate yet.

RunnerError widens from Diag diag.Diagnostic to Diags []diag.Diagnostic. A Diag() method returns Diags[0] for pre-v0.56 call sites that read .Diag as a single value.

Expression-level recovery

print(@, @, @)
-- EXPECTED INSTANCE FIELD NAME -------- file.tya:1:8
expected instance field name near ","
…
-- EXPECTED INSTANCE FIELD NAME -------- file.tya:1:11
…
-- EXPECTED INSTANCE FIELD NAME -------- file.tya:1:14
…

Found 3 error(s), 0 warning(s).

Three errors, one pass. The same recovery rules apply inside ArrayLit ([…]) and DictLit ({…}) literals. Nested brackets are skipped over so an inner stray , does not stop outer-list recovery.

Binary chains (a + broken + c) and member chains (a.broken.c) remain whole-expression failures in v0.56 and are queued for v0.57+.

Migration

For every direct caller of the renamed APIs, add a _ to the destructure or read the new diags slice:

// Pre-v0.56
prog, err := parser.Parse(toks)

// v0.56 (no diags)
prog, _, err := parser.Parse(toks)

// v0.56 (consume diags)
prog, diags, err := parser.Parse(toks)
for _, d := range diags {  }

errors.As(err, &perr) continues to work, so callers that unwrap the structured payload via the wrapper do not need to move yet. The wrappers will be revisited once every caller has migrated to direct slice access.

Tooling

Next