Files
swift-mirror/test/ModuleInterface/Observable.swift
Saleem Abdulrasool 99453fc2e8 test: introduce a new %swift-plugin-dir macro
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.
2023-09-04 13:04:18 -07:00

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)
}