diff --git a/Sources/TestingMacros/TestDeclarationMacro.swift b/Sources/TestingMacros/TestDeclarationMacro.swift index 2a4da4e3c..307b1615d 100644 --- a/Sources/TestingMacros/TestDeclarationMacro.swift +++ b/Sources/TestingMacros/TestDeclarationMacro.swift @@ -328,7 +328,7 @@ public struct TestDeclarationMacro: PeerMacro, Sendable { } FunctionParameterSyntax( firstName: .wildcardToken(), - type: "isolated (any Actor)?" as TypeSyntax, + type: "isolated (any _Concurrency.Actor)?" as TypeSyntax, defaultValue: InitializerClauseSyntax(value: "Testing.__defaultSynchronousIsolationContext" as ExprSyntax) ) } diff --git a/Tests/TestingTests/MiscellaneousTests.swift b/Tests/TestingTests/MiscellaneousTests.swift index 1f18f20a9..b4b12a217 100644 --- a/Tests/TestingTests/MiscellaneousTests.swift +++ b/Tests/TestingTests/MiscellaneousTests.swift @@ -139,6 +139,11 @@ struct SendableTests: Sendable { @Suite("Named Sendable test type", .hidden) struct NamedSendableTests: Sendable {} +// This is meant to help detect unqualified usages of the `Actor` protocol from +// Swift's `_Concurrency` module in macro expansion code, since it's possible +// for another module to declare a type with that name. +private class Actor {} + #if !SWT_NO_GLOBAL_ACTORS @Suite(.hidden) @MainActor