Skip to content

[5.9][Macros] Add back the ExtensionMacro feature identifier as a LANGUAGE_FEATURE for use in swiftinterfaces. #67628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/swift/Basic/Features.def
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ LANGUAGE_FEATURE(
FreestandingExpressionMacros, 382, "Expression macros",
hasSwiftSwiftParser)
LANGUAGE_FEATURE(AttachedMacros, 389, "Attached macros", hasSwiftSwiftParser)
LANGUAGE_FEATURE(ExtensionMacros, 402, "Extension macros", hasSwiftSwiftParser)
LANGUAGE_FEATURE(MoveOnly, 390, "noncopyable types", true)
LANGUAGE_FEATURE(ParameterPacks, 393, "Value and type parameter packs", true)
LANGUAGE_FEATURE(FreestandingMacros, 397, "freestanding declaration macros", true)
Expand Down
7 changes: 7 additions & 0 deletions test/Macros/Inputs/ConformanceMacroLib.swiftinterface
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@

@attached(conformance)
public macro Equatable() = #externalMacro(module: "MacroDefinition", type: "EquatableMacro")

#if compiler(>=5.3) && $Macros && $AttachedMacros && $ExtensionMacros
#if $ExtensionMacroAttr
@attached(extension, conformances: Swift.Hashable)
public macro Hashable() = #externalMacro(module: "MacroDefinition", type: "HashableMacro")
#endif
#endif
6 changes: 6 additions & 0 deletions test/Macros/imported_conformance_macro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ struct S {}

// CHECK-DUMP: extension S: Equatable {
// CHECK-DUMP: }

@Hashable
struct T {}

// CHECK-DUMP: extension T: Hashable {
// CHECK-DUMP: }