Skip to content

Local rename is not working in inactive #if clause #63611

Open
@ahoppen

Description

@ahoppen

In the following new test case cursor info is reporting results for size but local rename fails because the variable is defined in an inactive #if region.

#if false
func test() {
  // RUN: %sourcekitd-test -req=cursor -pos=%(line + 2):9 %s -- %s | %FileCheck %s --check-prefix CURSOR
  // RUN: %sourcekitd-test -req=refactoring.rename.local -pos=%(line + 1):9 %s -- %s
    let size: Int
}
#endif

// CURSOR: <Declaration>let size: <Type usr="s:Si">Int</Type></Declaration>

rdar://105382680

Metadata

Metadata

Assignees

No one assigned

    Labels

    #ifFeature → compiler control statements: Conditional compilation blocksbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compiler control statementsFeature: compiler control statementsfound by stress testerFlag: An issue found by the SourceKit stress testerrefactoringArea → source tooling: refactoringsource toolingArea: IDE support, SourceKit, and other source tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions