Skip to content

Separate type collection and numeric rules from semantic validation #720

Closed

Description

@LunaStev

Motivation

front/parser/src/verification.rs combines program type collection, alias lookup, binding scopes, expression/control-flow validation, numeric compatibility rules, HIR fact recording, and diagnostics. Contributors changing a numeric rule must navigate unrelated declaration and validator-state machinery.

Scope

Extract cohesive modules behind the existing verification facade in two reviewable stages:

  1. Program/type collection and alias lookup around ProgramTypes.
  2. Pure numeric compatibility, literal-range, and assignability helpers.

Keep mutable Validator state, spans, and HIR recording with their current owner while establishing these boundaries. Define a one-way dependency structure without exposing internals solely for tests.

This is a behavior-preserving extraction. Semantic fixes, diagnostic migration (#346), and new conversion policies belong in separate changes.

Completion criteria

  • Preserve public entry points, accepted/rejected programs, diagnostic codes/spans, and typed-HIR facts.
  • Give each extracted module a clear responsibility documented in code.
  • Add focused tests for independently testable helpers.
  • Pass existing parser, frontend, and codegen regressions without module cycles or unrelated behavior changes.

Difficulty: hard.

Activity

  1. added
    enhancement
    help wanted
    refactor
    on Sep 24, 2026
  2. changed the title [-][Proposal]: Separate semantic type collection and numeric rules from the validator[/-] [+]Separate type collection and numeric rules from semantic validation[/+] on Sep 24, 2026
  3. self-assigned this
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementhelp wantedrefactor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions