-
Notifications
You must be signed in to change notification settings - Fork 116
Labels
bug🪲 Something isn't working🪲 Something isn't workingconcurrency🔀 Swift concurrency/sendability issues🔀 Swift concurrency/sendability issuesmacros🔭 Related to Swift macros such as @Test or #expect🔭 Related to Swift macros such as @Test or #expectpublic-apiAffects public APIAffects public API
Milestone
Description
Given the following test function:
@available(*, noasync)
func f() {}
@Test func g() {
#expect(throws: (any Error).self) {
f()
}
}
In Swift 6.2 the compiler emits a warning due to improved typechecking during macro expansion:
⚠️ function 'f' is unavailable from asynchronous contexts; this will be an error in a future Swift language mode
Because the compiler is now inferring the type of the closure passed to #expect(throws:)
as async
before macro expansion rather than inferring its type (as non-async
) after.
Metadata
Metadata
Assignees
Labels
bug🪲 Something isn't working🪲 Something isn't workingconcurrency🔀 Swift concurrency/sendability issues🔀 Swift concurrency/sendability issuesmacros🔭 Related to Swift macros such as @Test or #expect🔭 Related to Swift macros such as @Test or #expectpublic-apiAffects public APIAffects public API