Skip to content

Commit

Permalink
Add actor support
Browse files Browse the repository at this point in the history
  • Loading branch information
finnvoor committed Oct 14, 2023
1 parent 8229f07 commit 453eeec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/StaticLoggerMacros/StaticLoggerMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public struct StaticLogger: MemberMacro {
providingMembersOf declaration: some SwiftSyntax.DeclGroupSyntax,
in _: some SwiftSyntaxMacros.MacroExpansionContext
) throws -> [SwiftSyntax.DeclSyntax] {
guard let declarationName = declaration.as(ClassDeclSyntax.self)?.name.text ?? declaration.as(StructDeclSyntax.self)?.name.text ?? declaration.as(EnumDeclSyntax.self)?.name.text else {
guard let declarationName = declaration.as(ClassDeclSyntax.self)?.name.text ?? declaration.as(StructDeclSyntax.self)?.name.text ?? declaration.as(ActorDeclSyntax.self)?.name.text ?? declaration.as(EnumDeclSyntax.self)?.name.text else {
throw Error.unknownDeclaration
}

Expand Down Expand Up @@ -53,7 +53,7 @@ extension StaticLogger {
var description: String {
switch self {
case .unknownDeclaration:
"Unknown declaration — StaticLogger must be used on a class, struct, or enum"
"Unknown declaration — StaticLogger must be used on a class, struct, actor, or enum"
}
}
}
Expand Down

0 comments on commit 453eeec

Please sign in to comment.