Skip to content

Commit 7025b03

Browse files
hnrklssnj-hui
andauthored
Update lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift
Co-authored-by: John Hui <[email protected]>
1 parent 1c0c558 commit 7025b03

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,10 +1808,11 @@ public struct SwiftifyImportProtocolMacro: ExtensionMacro {
18081808
}
18091809
let overloads = try arguments.map {
18101810
let (method, args) = try parseProtocolMacroParam($0, methods: methods)
1811-
let hasVisibilityModifier = method.modifiers.contains { modifier in
1812-
let modName = modifier.name.trimmed.text
1813-
return modName == "public" || modName == "internal" || modName == "open"
1814-
|| modName == "private" || modName == "filePrivate"
1811+
let hasVisibilityModifier = method.modifiers.contains {
1812+
return switch $0.name.trimmed.text {
1813+
case "open", "public", "package", "internal", "fileprivate", "private": true
1814+
default: false
1815+
}
18151816
}
18161817
let result = try constructOverloadFunction(
18171818
forDecl: method, leadingTrivia: Trivia(), args: args,

0 commit comments

Comments
 (0)