mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Previously we were skipping the macro’s definition (i.e. the part after `=` in a macro declaration if it wasn’t type checked. Since syntactic rename doesn’t type-check anything, it was thus skippin the macro definition. Add a flag to `ASTWalker` that allows `NameMatcher` to opt-out of this behavior.
12 lines
600 B
Swift
12 lines
600 B
Swift
// RUN: %empty-directory(%t.ranges)
|
|
// RUN: %refactor -find-rename-ranges -source-filename %s -pos="test" -is-function-like -old-name "StringifyMacro" | %FileCheck %s
|
|
|
|
// CHECK: struct /*test:def*/<base>StringifyMacro</base> {}
|
|
// CHECK: @freestanding(expression)
|
|
// CHECK: macro stringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "MyMacroMacros", type: "/*test:ref*/<base>StringifyMacro</base>")
|
|
|
|
struct /*test:def*/StringifyMacro {}
|
|
|
|
@freestanding(expression)
|
|
macro stringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "MyMacroMacros", type: "/*test:ref*/StringifyMacro")
|