mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* `@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>
27 lines
849 B
Swift
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)
|
|
}
|