@@ -34,6 +34,18 @@ public struct TopLevelStruct {
34
34
set ( newValue) { }
35
35
}
36
36
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
+
37
49
@backDeployed ( before: macOS 12.0 )
38
50
public subscript( at index: Int ) -> Int {
39
51
get { 42 }
@@ -234,7 +246,6 @@ public final class CannotBackDeployClassDeinit {
234
246
deinit { }
235
247
}
236
248
237
- // Ok, final decls in a non-final, derived class
238
249
public class CannotBackDeployOverride : TopLevelClass {
239
250
@backDeployed ( before: macOS 12.0 ) // expected-error {{'@backDeployed' cannot be combined with 'override'}}
240
251
final public override func hook( ) { }
@@ -293,6 +304,40 @@ public func cannotBackDeployFuncWithOpaqueResultType() -> some TopLevelProtocol
293
304
return ConformsToTopLevelProtocol ( )
294
305
}
295
306
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
+
296
341
// MARK: - Function body diagnostics
297
342
298
343
public struct FunctionBodyDiagnostics {
0 commit comments