Skip to content

Align parse_type with the lexer numeric type vocabulary #405

Closed

Description

@LunaStev

Problem

The string-based type parser in front/parser/src/parser/types.rs accepts any iNN, uNN, or fNN spelling, while the lexer exposes a fixed built-in vocabulary. This can make nested generic spellings such as Box<f12> look like a valid float type until LLVM rejects it. The current prefix checks also try to parse isz and usz as numeric widths before reaching target-sized type handling.

Scope

  • Make parse_type accept exactly the built-in numeric spellings supported by the lexer.
  • Preserve isz and usz in nested pointer, array, and generic arguments.
  • Reject unsupported widths without reaching LLVM.
  • Add direct parser tests and at least one CLI check regression for a nested invalid numeric type.
  • Do not add new numeric widths.

Completion criteria

  • Supported signed, unsigned, float, isz, and usz spellings round-trip.
  • Unsupported forms such as f12, i7, and overflow widths are rejected before code generation.
  • Nested ptr, array, and custom generic applications are covered.
  • The failure is structured and does not panic.

Activity

  1. added
    bug
    good first issue
    needs testing
    on Aug 28, 2026
  2. LunaStev commented on Sep 5, 2026

    @LunaStev
    MemberAuthor

    Reconfirmed during the alpha-readiness audit following #474.

    fun identity(value: isz) -> isz { return value; }
    fun main() -> i32 { return identity(1 as isz) as i32; }
    

    On the current head, wavec check exits 101 at front/parser/src/parser/types.rs:76 with Unhandled integer type: ISZ. This remains an alpha blocker; no duplicate issue was opened. The next-work plan is recorded locally before implementation.

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

    buggood first issueneeds testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions