From 453eeecf2ae62df1ba6cf691799ed4b47f025baa Mon Sep 17 00:00:00 2001 From: Finn Voorhees Date: Sat, 14 Oct 2023 16:58:46 +0100 Subject: [PATCH] Add actor support --- Sources/StaticLoggerMacros/StaticLoggerMacro.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/StaticLoggerMacros/StaticLoggerMacro.swift b/Sources/StaticLoggerMacros/StaticLoggerMacro.swift index d0516d8..cb2a41a 100644 --- a/Sources/StaticLoggerMacros/StaticLoggerMacro.swift +++ b/Sources/StaticLoggerMacros/StaticLoggerMacro.swift @@ -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 } @@ -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" } } }