Skip to content

Add a check-only example for payload variants and exhaustive matching #403

Closed

Description

@LunaStev

Tracked by #347.

Why

The variant frontend is implemented, but there is no maintained example showing the intended declaration, construction, payload binding, generic use, and exhaustive match syntax. LLVM lowering is deliberately not available yet, so the example must document the frontend contract honestly.

Scope

  • Add one focused example under examples/.
  • Include a generic payload variant, a payload-free case, constructors, and an exhaustive match with bound payload values.
  • Keep it valid under wavec check.
  • Add a short header comment saying native code generation awaits the backend task.
  • Do not add backend lowering or represent variants as integer enums.

Completion criteria

  • wavec check accepts the example.
  • tools/check_wave_corpus.py includes and passes it.
  • The example is short enough to teach from.
  • Syntax and semantics match the tests in front/parser/tests/variant_frontend.rs.

Activity

  1. added
    documentation
    good first issue
    needs testing
    on Aug 28, 2026
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

    documentationgood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions