@@ -34,6 +34,18 @@ public struct TopLevelStruct {
3434 set ( newValue) { }
3535 }
3636
37+ @backDeployed ( before: macOS 12.0 )
38+ public private( set) var readWritePropertyPrivateSet : Int {
39+ get { 42 }
40+ set ( newValue) { }
41+ }
42+
43+ @backDeployed ( before: macOS 12.0 )
44+ public internal( set) var readWritePropertyInternalSet : Int {
45+ get { 42 }
46+ set ( newValue) { }
47+ }
48+
3749 @backDeployed ( before: macOS 12.0 )
3850 public subscript( at index: Int ) -> Int {
3951 get { 42 }
@@ -234,7 +246,6 @@ public final class CannotBackDeployClassDeinit {
234246 deinit { }
235247}
236248
237- // Ok, final decls in a non-final, derived class
238249public class CannotBackDeployOverride : TopLevelClass {
239250 @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' cannot be combined with 'override'}}
240251 final public override func hook( ) { }
@@ -293,6 +304,40 @@ public func cannotBackDeployFuncWithOpaqueResultType() -> some TopLevelProtocol
293304 return ConformsToTopLevelProtocol ( )
294305}
295306
307+ public struct CannotBackDeployNonPublicAccessors {
308+ private var privateVar : Int {
309+ @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' may not be used on private declarations}}
310+ get { 0 }
311+
312+ @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' may not be used on private declarations}}
313+ set { }
314+ }
315+
316+ internal var internalVar : Int {
317+ @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' may not be used on internal declarations}}
318+ get { 0 }
319+
320+ @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' may not be used on internal declarations}}
321+ set { }
322+ }
323+
324+ public private( set) var publicVarPrivateSet : Int {
325+ @backDeployed ( before: macOS 12.0 )
326+ get { 0 }
327+
328+ @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' may not be used on private declarations}}
329+ set { }
330+ }
331+
332+ public internal( set) var publicVarInternalSet : Int {
333+ @backDeployed ( before: macOS 12.0 )
334+ get { 0 }
335+
336+ @backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' may not be used on internal declarations}}
337+ set { }
338+ }
339+ }
340+
296341// MARK: - Function body diagnostics
297342
298343public struct FunctionBodyDiagnostics {
0 commit comments