mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
With the move to explicitly specifying the global actor for an isolated conformance, we can now have conformances whose isolation differs from that of the type, including having actors with global-actor-isolated conformances. Introduce this generalization to match the proposal, and update/add tests accordingly.
17 lines
553 B
Swift
17 lines
553 B
Swift
// RUN: %target-swift-frontend -typecheck -swift-version 6 -enable-library-evolution -module-name isolated_conformance -enable-experimental-feature IsolatedConformances -emit-module-interface-path - %s | %FileCheck %s
|
|
|
|
// REQUIRES: swift_feature_IsolatedConformances
|
|
// REQUIRES: concurrency
|
|
|
|
public protocol MyProtocol {
|
|
func f()
|
|
}
|
|
|
|
@MainActor
|
|
public class MyClass { }
|
|
|
|
// CHECK: extension isolated_conformance.MyClass : @{{.*}}MainActor isolated_conformance.MyProtocol {
|
|
extension MyClass: @MainActor MyProtocol {
|
|
@MainActor public func f() { }
|
|
}
|