Skip to content

Preserve the let-to-var migration diagnostic #360

Closed

Description

@LunaStev

Tracked by #346.

Problem

Wave removed local let and let mut declarations in favor of var. Legacy parser code already knows the correct migration message, but the structured top-level error replaces it with a generic "failed to parse function declaration" diagnostic.

Expected diagnostic

For both forms:

let value: i32 = 1;
let mut value: i32 = 1;

the error should point to let and tell the user to use var.

Scope

  • Propagate the local declaration failure as a structured parser diagnostic.
  • Preserve the exact source span and migration help.
  • Keep let tokenized only so it can produce this diagnostic; do not restore the syntax.
  • Add check/build parity tests for both forms.
  • Add a valid var control case.

Completion criteria

  • Human and JSON output identify the let token.
  • Help explicitly recommends var.
  • let and let mut remain syntax errors.
  • No diagnostic is printed separately to stdout.

Activity

  1. added
    enhancement
    good first issue
    on Aug 25, 2026
  2. added a commit that references this issue on Oct 22, 2026
    aef39a5
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

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions