Skip to content

Symbol and global rewrites skip structural match patterns #511

Description

@tinovyatkin

Problem

Several rename paths do not traverse match statements or their patterns.

  • rewrite_aliases_in_stmt has no Stmt::Match arm and falls through to an Unhandled statement type debug message.
  • rewrite_global_statements_only does not recurse into match case bodies.
  • The module-variable transformers process match subjects, guards, and bodies but explicitly leave patterns unchanged.

Pattern expressions are runtime symbol references. For example, case status.READY: must be rewritten if status or the referenced symbol was renamed during inlining or conflict resolution.

Impact

A symbol collision can be resolved in definitions and ordinary expressions while leaving stale names in match value/class patterns or nested global declarations. The generated bundle can then raise NameError, match against the wrong object, or keep inconsistent global declarations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions