I'm having a strange experience using Testing framework in Xcode 16.3.
When I use @testable import iOS_AppName
I'm getting the error below in the method and when I remove it the build works fine.
Showing All Errors Only
/var/folders/dr/xxmgy3xd1pb4ml_4c73_s78r0000gn/T/swift-generated-sources/@__swiftmacro_17iOS_AppNameTests7AppTestV8testName0F0fMp_.swift:3:90: 'any' has no effect on concrete type 'Actor'
/var/folders/dr/xxmgy3xd1pb4ml_4c73_s78r0000gn/T/swift-generated-sources/@__swiftmacro_17iOS_AppNameTests7AppTestV8testName0F0fMp_.swift:3:80: 'isolated' parameter type 'Actor?' does not conform to 'Actor' or 'DistributedActor'
I can only run the tests with @testable import iOS_AppName
by adding @MainActor
or async
to the method.
Also in Xcode 16.2 I have no problem.
My test code:
@testable import iOS_AppName
import Testing
class AppClass { // This class is in the app's target, I left it here just to make it visible
var name = "Swift"
}
struct AppTest {
@Test
func testName() {
let appClass = AppClass()
#expect(appClass.name == "Swift")
}
}
Does anyone know if there is any configuration in the project that I can do to solve this?
This error is very strange and I would like your opinion before I add async to all the tests.