- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathObservable.swift
25 lines (19 loc) · 782 Bytes
/
Observable.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// RUN: %empty-directory(%t)
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -plugin-path %swift-plugin-dir -disable-availability-checking
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library -disable-availability-checking
// RUN: %FileCheck %s < %t/Library.swiftinterface
// REQUIRES: swift_swift_parser
// REQUIRES: observation
import Observation
// CHECK-NOT: @Observable
// CHECK-NOT: @ObservationIgnored
// CHECK-NOT: @ObservationTracked
@Observable
publicclassSomeClass{
publicvarfield=3
@ObservationIgnoredpublicvarignored=4
}
publicfunc requiresObservable<T:Observable>(_:T){}
@inlinablefunc useObservable(sc:SomeClass){
requiresObservable(sc)
}