Files
swift-mirror/test/refactoring/rename/localEnum.swift
Alex Hoppen d2f7d518ed [Refactoring] Always walk parent decl context of value decl for local rename
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
2022-05-09 17:04:36 +02:00

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