Skip to content

Commit eda1b7c

Browse files
authored
Merge pull request #1762 from DougGregor/freestanding-macro-redundant-role-check
2 parents 4d8981f + 937b85b commit eda1b7c

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Sources/SwiftCompilerPluginMessageHandling/Macros.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,7 @@ extension CompilerPluginMessageHandler {
4949

5050
let macroRole: MacroRole
5151
if let pluginMacroRole {
52-
switch pluginMacroRole {
53-
case .expression: macroRole = .expression
54-
case .declaration: macroRole = .declaration
55-
case .codeItem: macroRole = .codeItem
56-
57-
case .accessor, .conformance, .member, .memberAttribute, .peer:
58-
throw MacroExpansionError.invalidMacroRole(pluginMacroRole)
59-
}
52+
macroRole = MacroRole(messageMacroRole: pluginMacroRole)
6053
} else {
6154
macroRole = try inferFreestandingMacroRole(definition: macroDefinition)
6255
}

0 commit comments

Comments
 (0)