diff --git a/Sources/TestingMacros/TestDeclarationMacro.swift b/Sources/TestingMacros/TestDeclarationMacro.swift index d52baa0d2..5ffb3dc33 100644 --- a/Sources/TestingMacros/TestDeclarationMacro.swift +++ b/Sources/TestingMacros/TestDeclarationMacro.swift @@ -333,7 +333,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 02f2cc768..3177969ee 100644 --- a/Tests/TestingTests/MiscellaneousTests.swift +++ b/Tests/TestingTests/MiscellaneousTests.swift @@ -137,6 +137,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