Skip to content

Rename and inline refactor did not recognize type alias statements as variable assignment #862

Open

Description

@lieryan

Describe the bug

The type alias statement is a new kind of assignment statement since Python 3.12+. Currently they are not recognised as assignment statement that can define a variable.

To Reproduce
Steps to reproduce the behavior:

  1. Code before refactoring:
type old_name_1 = int
x: old_name_1 = 1

type Alias[old_name_2] = list[old_name_2]
print(old_name_2) # this should be untouched
  1. Describe the refactoring you want to do: rename old_name_xxx to new_name_xxx

  2. Expected code after refactoring:

type new_name_1 = int
x: new_name_1 = 1

type Alias[new_name_2] = list[new_name_2]
print(old_name_2) # this should be untouched
  1. Describe the error or unexpected result that you are getting
RefactoringError: Rename refactoring should be performed on resolvable python identifiers

Activity

  1. added
    bug
    on Aug 20, 2026
  2. changed the title [-]Rename refactor did not recognize type alias statements as variable assignment[/-] [+]Rename and inline refactor did not recognize type alias statements as variable assignment[/+] on Aug 20, 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

    buginline-refactorrename-refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions