mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
I added a disable flag -disable-region-based-isolation-with-strict-concurrency so that we do not need to update the current tests. It is only available when asserts are enabled to ensure users cannot use it. rdar://125918028
25 lines
850 B
Swift
25 lines
850 B
Swift
// RUN: %target-swift-frontend -disable-availability-checking -strict-concurrency=complete %s -emit-sil -o /dev/null -verify -disable-region-based-isolation-with-strict-concurrency
|
|
// RUN: %target-swift-frontend -disable-availability-checking -strict-concurrency=complete %s -emit-sil -o /dev/null -verify
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: objc_interop
|
|
// REQUIRES: asserts
|
|
|
|
import Foundation
|
|
|
|
final class A: NSObject, Sendable {
|
|
let x: Int = 5
|
|
}
|
|
|
|
final class B: NSObject, Sendable {
|
|
var x: Int = 5 // expected-warning{{stored property 'x' of 'Sendable'-conforming class 'B' is mutable}}
|
|
}
|
|
|
|
class C { } // expected-note{{class 'C' does not conform to the 'Sendable' protocol}}
|
|
|
|
final class D: NSObject, Sendable {
|
|
let c: C = C() // expected-warning{{stored property 'c' of 'Sendable'-conforming class 'D' has non-sendable type 'C'}}
|
|
}
|
|
|
|
|