Skip to content

compiler: improve diagnostics and multiline literal union parsing #470

Description

@eggplantiny

Context

Derived from the 2026-04-25 and 2026-04-28 Claude Code usage review.

Claude Code reported compiler errors such as internal parser/type mismatch codes without enough user-oriented explanation, and multiline literal union syntax appeared to be rejected even though literal-only unions are semantically supported.

Current assessment

SPEC status: diagnostic structure is provided, but quality may be insufficient. Literal-only unions are supported semantically; multiline parsing appears to be parser/DX work rather than a new semantic feature.

CompileDiagnostic already has structure for severity, code, message, location, source, and optional suggestion. The implementation should fill these fields with intent-oriented messages and suggestions where possible.

Desired outcome

Improve compiler diagnostic messages/suggestions and accept line breaks in literal-only union syntax where the grammar should allow it.

Acceptance criteria

  • Diagnostics for common parser/type errors include actionable messages and suggestion when useful.
  • Multiline literal-only union syntax is parsed or explicitly documented if intentionally unsupported.
  • Tests cover type X = "a" | "b" | "c" across multiple lines.
  • Non-trivial arbitrary unions remain rejected unless a separate SPEC change authorizes them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MELP2Priority: important, but not nextbugSomething isn't workingpkg:compilerOwning package: @manifesto-ai/compilerstatus:triageStatus: needs active triage or decision

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions