Skip to content

Commit 3047cd3

Browse files
committed
Tests: Account for concurrency availability in attr_backDeploy.swift and move tests for @_backDeploy and @objc interaction to attr_objc.swift.
1 parent 0f890b8 commit 3047cd3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

test/attr/attr_backDeploy.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ final public class FinalTopLevelClass {
5555
}
5656

5757
// OK: final function decls on an actor
58-
@available(macOS 11.0, *)
58+
@available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
5959
public actor TopLevelActor {
6060
@available(macOS 11.0, *)
6161
@_backDeploy(macOS 12.0)
@@ -123,7 +123,7 @@ extension TopLevelStruct {}
123123
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
124124
protocol CannotBackDeployProtocol {}
125125

126-
@available(macOS 11.0, *)
126+
@available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
127127
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
128128
public actor CannotBackDeployActor {}
129129

@@ -147,11 +147,6 @@ public class TopLevelClass2 {
147147
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' cannot be applied to a non-final instance method}}
148148
public func nonFinalMethod() {}
149149

150-
@available(macOS 11.0, *)
151-
@_backDeploy(macOS 12.0)
152-
@objc // expected-error {{'@objc' cannot be applied to a back deployed instance method}}
153-
final public func objcMethod() {}
154-
155150
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' cannot be applied to a non-final class method}}
156151
public class func nonFinalClassMethod() {}
157152
}

test/attr/attr_objc.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,3 +2655,12 @@ class SR12801 {
26552655
subscript<T>(foo : [T]) -> Int { return 0 }
26562656
// access-note-adjust{{@objc}} expected-error@-1 {{subscript cannot be marked @objc because it has generic parameters}}
26572657
}
2658+
2659+
// @_backDeploy
2660+
2661+
public class BackDeployClass {
2662+
@available(macOS 11.0, *)
2663+
@_backDeploy(macOS 12.0)
2664+
@objc // expected-error {{'@objc' cannot be applied to a back deployed instance method}}
2665+
final public func objcMethod() {}
2666+
}

0 commit comments

Comments
 (0)