Files
swift-mirror/test/Concurrency/concurrent_value_checking_objc.swift
Doug Gregor ecf36ba6bc Enable ConcurrentValue checking as part of Concurrency mode.
Drop the separate flag guarding this checking.
2021-02-22 00:29:56 -08:00

23 lines
540 B
Swift

// RUN: %target-typecheck-verify-swift -enable-experimental-concurrency
// REQUIRES: concurrency
// REQUIRES: objc_interop
import Foundation
class A: NSObject, ConcurrentValue {
let x: Int = 5
}
class B: NSObject, ConcurrentValue {
var x: Int = 5 // expected-error{{stored property 'x' of 'ConcurrentValue'-conforming class 'B' is mutable}}
}
class C { }
class D: NSObject, ConcurrentValue {
let c: C = C() // expected-error{{stored property 'c' of 'ConcurrentValue'-conforming class 'D' has non-concurrent-value type 'C'}}
}