Skip to content

Renaming a member does not rename references to it in a closure #2203

@ahoppen

Description

@ahoppen

The following new test case fails to rename x to yyy inside runClosure

try await assertSingleFileRename(
  """
  func runClosure(body: () -> Void) {}

  struct Foo {
    var 1️⃣x: Int

    func foo() {
      runClosure {
        x = 2
      }
    }
  }
  """,
  newName: "yyy",
  expectedPrepareRenamePlaceholder: "x",
  expected: """
  func runClosure(body: () -> Void) {}

  struct Foo {
    var yyy: Int

    func foo() {
      runClosure {
        yyy = 2
      }
    }
  }
  """
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions