@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>
This commit is contained in:
treastrain / Tanaka Ryoga
2024-04-10 05:32:03 +09:00
committed by GitHub
parent 4b440a1d80
commit a1c49d0139
2 changed files with 4 additions and 2 deletions

View File

@@ -118,6 +118,7 @@ extension DeclModifierListSyntax {
case .fileprivate: fallthrough
case .private: fallthrough
case .internal: fallthrough
case .package: fallthrough
case .public:
return false
default:

View File

@@ -1,6 +1,6 @@
// 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: %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
@@ -15,6 +15,7 @@ import Observation
@Observable
public class SomeClass {
public var field = 3
package var test = 4
@ObservationIgnored public var ignored = 4
}