mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This matches send non sendable but importantly also makes it clear that we are talking about something that doesn't conform to the Sendable protocol which is capitalized. rdar://151802975
24 lines
673 B
Swift
24 lines
673 B
Swift
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -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'}}
|
|
}
|
|
|
|
|