Bug: Xcode Refactor -> Rename with Conditional Compilation

When renaming A.value, it also causes the value inside the conditional compilation in checkRename to be renamed. How to resolve or avoid this situation?

class A {
    let value = "1"
}
class B {
    var value = 0
}

func checkRename() {
    var b = B()
#if os(iOS)
    b.value = 456
#elseif os(macOS)
    b.value = 789
#endif
}

Xcode Version 15.4 (15F31d).

Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Albert Pascual
  Worldwide Developer Relations.

Bug: Xcode Refactor -> Rename with Conditional Compilation
 
 
Q