Skip to content

Commit 61e5811

Browse files
committed
[NFC] Update IDE, Index, ModuleInterface, and SourceKit tests to remove
conformance macros.
1 parent 9ac257b commit 61e5811

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

test/IDE/complete_macro_attribute.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ macro FreestandingMacro
1212
@attached(#^ATTACHED_ROLE^#)
1313
macro AttachedMacro
1414

15-
// ATTACHED_ROLE: Begin completions, 5 items
15+
// ATTACHED_ROLE: Begin completions, 6 items
1616
// ATTACHED_ROLE-DAG: Keyword/None: accessor; name=accessor
1717
// ATTACHED_ROLE-DAG: Keyword/None: memberAttribute; name=memberAttribute
1818
// ATTACHED_ROLE-DAG: Keyword/None: member; name=member
1919
// ATTACHED_ROLE-DAG: Keyword/None: peer; name=peer
2020
// ATTACHED_ROLE-DAG: Keyword/None: conformance; name=conformance
21+
// ATTACHED_ROLE-DAG: Keyword/None: extension; name=extension
2122

2223
@freestanding(declaration, #^NAMES_POSITION^#)
2324
macro FreestandingDeclarationMacro

test/IDE/complete_macros.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public macro AttachedMemberAttributeMacro()
5252
@attached(peer)
5353
public macro AttachedPeerMacro()
5454

55-
@attached(conformance)
55+
@attached(extension)
5656
public macro AttachedConformanceMacro()
5757

5858
@freestanding(expression)
@@ -61,7 +61,7 @@ public macro AttachedConformanceMacro()
6161
@attached(member)
6262
@attached(memberAttribute)
6363
@attached(peer)
64-
@attached(conformance)
64+
@attached(extension)
6565
public macro EverythingMacro()
6666

6767
//--- MacroUses.swift

test/IDE/complete_optionset.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func foo() {
1717
}
1818

1919
@attached(member, names: named(RawValue), named(rawValue), named(`init`), arbitrary)
20-
@attached(conformance)
20+
@attached(extension, conformances: OptionSet)
2121
public macro OptionSet<RawType>() =
2222
#externalMacro(module: "SwiftMacros", type: "OptionSetMacro")
2323

test/Index/index_macros.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ macro freestandingDecl<T>(arg: T) = #externalMacro(module: "IndexMacros", type:
2626
macro Accessor() = #externalMacro(module: "IndexMacros", type: "SomeAccessorMacro")
2727
// CHECK: [[@LINE-1]]:7 | macro/Swift | Accessor() | [[ACCESSOR_USR:.*]] | Def
2828

29-
@attached(conformance)
29+
@attached(extension, conformances: TestProto)
3030
macro Conformance() = #externalMacro(module: "IndexMacros", type: "SomeConformanceMacro")
3131
// CHECK: [[@LINE-1]]:7 | macro/Swift | Conformance() | [[CONFORMANCE_USR:.*]] | Def
3232

test/ModuleInterface/macros.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
@attached(accessor, names: named(init)) public macro AccessorInitFunc() = #externalMacro(module: "SomeModule", type: "AccessorInitFuncMacro")
5151

5252
// CHECK: #if compiler(>=5.3) && $Macros && $AttachedMacros
53-
// CHECK: @attached(extension, conformances: Swift.Sendable) @attached(conformance) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
53+
// CHECK: @attached(extension, conformances: Swift.Sendable) @attached(member) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
5454
// CHECK-NEXT: #else
55-
// CHECK: @attached(conformance) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
55+
// CHECK: @attached(member) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
5656
// CHECK-NEXT: #endif
57-
@attached(extension, conformances: Sendable) @attached(conformance) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
57+
@attached(extension, conformances: Sendable) @attached(member) public macro AddSendable() = #externalMacro(module: "SomeModule", type: "SendableExtensionMacro")
5858

5959
// CHECK-NOT: internalStringify
6060
@freestanding(expression) macro internalStringify<T>(_ value: T) -> (T, String) = #externalMacro(module: "SomeModule", type: "StringifyMacro")

test/SourceKit/Macros/macro_basic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct S3 {
4545
}
4646
}
4747

48-
@attached(conformance)
48+
@attached(extension, conformances: Hashable)
4949
macro Hashable() = #externalMacro(module: "MacroDefinition", type: "HashableMacro")
5050

5151
@Hashable
@@ -263,7 +263,7 @@ macro anonymousTypes(_: () -> String) = #externalMacro(module: "MacroDefinition"
263263
//##-- Expansion on a conformance macro.
264264
// RUN: %sourcekitd-test -req=refactoring.expand.macro -pos=51:5 %s -- ${COMPILER_ARGS[@]} | %FileCheck -check-prefix=CONFORMANCE_EXPAND %s
265265
// CONFORMANCE_EXPAND: source.edit.kind.active:
266-
// CONFORMANCE_EXPAND-NEXT: 52:14-52:14 (@__swiftmacro_9MacroUser2S48HashablefMc_.swift) "extension S4: Hashable {
266+
// CONFORMANCE_EXPAND-NEXT: 52:14-52:14 (@__swiftmacro_9MacroUser2S48HashablefMe_.swift) "extension S4: Hashable {
267267
// CONFORMANCE_EXPAND-NEXT: }"
268268
// CONFORMANCE_EXPAND-NEXT: source.edit.kind.active:
269269
// CONFORMANCE_EXPAND-NEXT: 51:1-51:10 ""

test/SourceKit/Macros/macro_option_set.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func test(opts: ShippingOptions) {
1717
}
1818

1919
@attached(member, names: named(RawValue), named(rawValue), named(`init`), arbitrary)
20-
@attached(conformance)
20+
@attached(extension, conformances: OptionSet)
2121
public macro OptionSet<RawType>() =
2222
#externalMacro(module: "SwiftMacros", type: "OptionSetMacro")
2323

0 commit comments

Comments
 (0)