3
3
4
4
// MARK: - Valid declarations
5
5
6
- // OK: top level functions
6
+ // Ok, top level functions
7
7
@available ( macOS 11 . 0 , * )
8
8
@_backDeploy ( before: macOS 12.0 )
9
9
public func backDeployedTopLevelFunc( ) { }
10
10
11
- // OK: internal decls may be back deployed when @usableFromInline
11
+ // Ok, internal decls may be back deployed when @usableFromInline
12
12
@available ( macOS 11 . 0 , * )
13
13
@_backDeploy ( before: macOS 12.0 )
14
14
@usableFromInline
15
15
internal func backDeployedUsableFromInlineTopLevelFunc( ) { }
16
16
17
- // OK: function/property/subscript decls in a struct
17
+ // Ok, function/property/subscript decls in a struct
18
18
public struct TopLevelStruct {
19
19
@available ( macOS 11 . 0 , * )
20
20
@_backDeploy ( before: macOS 12.0 )
@@ -53,7 +53,7 @@ public struct TopLevelStruct {
53
53
}
54
54
}
55
55
56
- // OK: final function decls in a non-final class
56
+ // Ok, final function decls in a non-final class
57
57
public class TopLevelClass {
58
58
@available ( macOS 11 . 0 , * )
59
59
@_backDeploy ( before: macOS 12.0 )
@@ -72,7 +72,7 @@ public class TopLevelClass {
72
72
public final class func backDeployedClassMethod( ) { }
73
73
}
74
74
75
- // OK: function decls in a final class
75
+ // Ok, function decls in a final class
76
76
final public class FinalTopLevelClass {
77
77
@available ( macOS 11 . 0 , * )
78
78
@_backDeploy ( before: macOS 12.0 )
@@ -83,20 +83,20 @@ final public class FinalTopLevelClass {
83
83
public var backDeployedComputedProperty : Int { 98 }
84
84
}
85
85
86
- // OK: final function decls on an actor
86
+ // Ok, final function decls on an actor
87
87
@available ( macOS 11 . 0 , iOS 14 . 0 , watchOS 7 . 0 , tvOS 14 . 0 , * )
88
88
public actor TopLevelActor {
89
89
@available ( macOS 11 . 0 , * )
90
90
@_backDeploy ( before: macOS 12.0 )
91
91
final public func finalActorMethod( ) { }
92
92
93
- // OK: actor methods are effectively final
93
+ // Ok, actor methods are effectively final
94
94
@available ( macOS 11 . 0 , * )
95
95
@_backDeploy ( before: macOS 12.0 )
96
96
public func actorMethod( ) { }
97
97
}
98
98
99
- // OK: function decls in extension on public types
99
+ // Ok, function decls in extension on public types
100
100
extension TopLevelStruct {
101
101
@available ( macOS 11 . 0 , * )
102
102
@_backDeploy ( before: macOS 12.0 )
@@ -123,7 +123,8 @@ extension TopLevelProtocol {
123
123
public func backDeployedExtensionMethod( ) { }
124
124
}
125
125
126
- // MARK: - Unsupported declaration types
126
+
127
+ // MARK: - Unsupported declaration kinds
127
128
128
129
@_backDeploy ( before: macOS 12.0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
129
130
public class CannotBackDeployClass { }
@@ -166,6 +167,7 @@ protocol CannotBackDeployProtocol {}
166
167
@_backDeploy ( before: macOS 12.0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
167
168
public actor CannotBackDeployActor { }
168
169
170
+
169
171
// MARK: - Function body diagnostics
170
172
171
173
public struct FunctionBodyDiagnostics {
@@ -188,6 +190,7 @@ public struct FunctionBodyDiagnostics {
188
190
}
189
191
}
190
192
193
+
191
194
// MARK: - Incompatible declarations
192
195
193
196
@_backDeploy ( before: macOS 12.0 ) // expected-error {{'@_backDeploy' may not be used on fileprivate declarations}}
@@ -243,7 +246,7 @@ public func alwaysEmitIntoClientFunc() {}
243
246
244
247
@available ( macOS 11 . 0 , * )
245
248
@_backDeploy ( before: macOS 12.0 )
246
- @inlinable // OK
249
+ @inlinable // Ok
247
250
public func inlinableFunc( ) { }
248
251
249
252
@available ( macOS 11 . 0 , * )
0 commit comments