From 8fae486b2650610e3c63f778eba49be4bcf3bd29 Mon Sep 17 00:00:00 2001 From: Stuart Montgomery Date: Tue, 6 May 2025 17:03:50 -0700 Subject: [PATCH] Work around compiler bug affecting macro decls with #if-guarded availability when building w/legacy driver --- Sources/Testing/Expectations/Expectation+Macro.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/Testing/Expectations/Expectation+Macro.swift b/Sources/Testing/Expectations/Expectation+Macro.swift index d1492054..f85c7042 100644 --- a/Sources/Testing/Expectations/Expectation+Macro.swift +++ b/Sources/Testing/Expectations/Expectation+Macro.swift @@ -514,11 +514,12 @@ public macro require( /// @Metadata { /// @Available(Swift, introduced: 6.2) /// } +@freestanding(expression) +@discardableResult #if SWT_NO_EXIT_TESTS @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif -@discardableResult -@freestanding(expression) public macro expect( +public macro expect( processExitsWith expectedExitCondition: ExitTest.Condition, observing observedValues: [any PartialKeyPath & Sendable] = [], _ comment: @autoclosure () -> Comment? = nil, @@ -559,11 +560,12 @@ public macro require( /// @Metadata { /// @Available(Swift, introduced: 6.2) /// } +@freestanding(expression) +@discardableResult #if SWT_NO_EXIT_TESTS @available(*, unavailable, message: "Exit tests are not available on this platform.") #endif -@discardableResult -@freestanding(expression) public macro require( +public macro require( processExitsWith expectedExitCondition: ExitTest.Condition, observing observedValues: [any PartialKeyPath & Sendable] = [], _ comment: @autoclosure () -> Comment? = nil,