Skip to content

Refactoring on method change tick-masked variables  #70620

Open
@bastie

Description

@bastie

Description

In result of using tick masked variable names, refactoring destroy working code when rename method.

Reproduction

Use refactor -> rename on search to new name "looking"

import Foundation

public func search (for : String, in : [String]) {
  
  for next in `in` {
    if next == `for` {
      print ("Equals")
    }
  }
}

Expected behavior

Refactoring only change the method name not secondary variable names

Environment

swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

Additional information

RefactoringTickError-2.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    backticked identifiersFeature → identifiers: Backticked identifiers. Allows using reserved words as identifiersbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.refactoringArea → source tooling: refactoringsource toolingArea: IDE support, SourceKit, and other source toolingswift 5.9unexpected behaviorBug: Unexpected behavior or incorrect output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions