mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously, we only walked the parent scope of the decl context that declared the value to rename if it was a TopLevelCodeDecl. But also functions can have locally declared types that can be used in sibling scopes. Thus, we always need to walk the parent DeclContext of the one declaring the value we are renaming. rdar://89836229
15 lines
498 B
Swift
15 lines
498 B
Swift
func boop() {
|
|
enum LocalEnum {
|
|
case north
|
|
case south
|
|
}
|
|
|
|
print(LocalEnum.north)
|
|
}
|
|
|
|
// RUN: %empty-directory(%t.result)
|
|
// RUN: %refactor -rename -source-filename %s -pos=3:10 -new-name east > %t.result/north_def.swift
|
|
// RUN: diff -u %S/Outputs/localEnum/north.swift.expected %t.result/north_def.swift
|
|
// RUN: %refactor -rename -source-filename %s -pos=7:19 -new-name east > %t.result/north_ref.swift
|
|
// RUN: diff -u %S/Outputs/localEnum/north.swift.expected %t.result/north_ref.swift
|