I found this sample code while dealing with Quick library
class SwiftBaseClass {
func someMethod() async {
print(Thread.isMainThread) // false
}
}
@MainActor class SwiftSubClass: SwiftBaseClass {
override func someMethod() async {
print(Thread.isMainThread) // true
}
}
according to Using global actors on a type section of SE-0316, This Code looks invalid.(superclass and subclass has different isolation rule) Is there any information about this behavioral change? Or is it just a bug?
my toolchain is Xcode 14.3.1
.
and this is output of swiftc --versio
n
swift-driver version: 1.75.2 Apple Swift version 5.8.1 (swiftlang-5.8.0.124.5 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0