Files
swift-mirror/test/Concurrency/concurrent_value_checking_objc.swift
Doug Gregor 7e375f7df6 Use new Sendable staging infrastructure consistently.
The main effect of this change is that diagnostics about Sendable
conformances now follow the same minimal/full logic used for other
Sendable diagnostics, rather than having their own separate
computation.
2021-11-30 18:22:53 -08:00

23 lines
610 B
Swift

// RUN: %target-typecheck-verify-swift -disable-availability-checking -warn-concurrency
// REQUIRES: concurrency
// REQUIRES: objc_interop
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'}}
}