mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
29 lines
931 B
Swift
29 lines
931 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -plugin-path %swift-host-lib-dir/plugins -disable-availability-checking -enable-experimental-feature InitAccessors
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library -disable-availability-checking
|
|
// RUN: %FileCheck %s < %t/Library.swiftinterface
|
|
|
|
// Asserts is required for '-enable-experimental-feature InitAccessors'.
|
|
// REQUIRES: asserts
|
|
|
|
// REQUIRES: swift_swift_parser
|
|
// REQUIRES: observation
|
|
|
|
import _Observation
|
|
|
|
// CHECK-NOT: @Observable
|
|
// CHECK-NOT: @ObservationIgnored
|
|
// CHECK-NOT: @ObservationTracked
|
|
|
|
@Observable
|
|
public class SomeClass {
|
|
public var field = 3
|
|
@ObservationIgnored public var ignored = 4
|
|
}
|
|
|
|
public func requiresObservable<T: Observable>(_: T) { }
|
|
|
|
@inlinable func useObservable(sc: SomeClass) {
|
|
requiresObservable(sc)
|
|
}
|