Files
swift-mirror/test/ModuleInterface/Observable.swift
treastrain / Tanaka Ryoga a1c49d0139 @Observable Macro supports properties with the package access modifier (#71061)
* `@Observable` Macro supports properties with the `package` access modifier #71060

* Cherry-pick "Move the tests for package scopes to the module interface tests" 4e274ce0a5

---------

Co-authored-by: Philippe Hausler <phausler@apple.com>
2024-04-09 13:32:03 -07:00

27 lines
849 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -package-name Library -module-name Library -plugin-path %swift-plugin-dir -disable-availability-checking
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -package-name Library -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
package var test = 4
@ObservationIgnored public var ignored = 4
}
public func requiresObservable<T: Observable>(_: T) { }
@inlinable func useObservable(sc: SomeClass) {
requiresObservable(sc)
}