mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use this to define the macro location rather than the "host" dir (which is actually for the build and not the host). Furthermore, on Windows, the build dir is /usr/lib/swift as the host content is in the SDK. This prepares the tests for Windows.
26 lines
782 B
Swift
26 lines
782 B
Swift
// 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
|
|
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)
|
|
}
|