@@ -36,49 +36,38 @@ public class TopLevelClass {
36
36
37
37
// MARK: - Unsupported declaration types
38
38
39
- @available ( macOS 11 . 0 , * )
40
39
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
41
40
public class CannotBackDeployClass { }
42
41
43
- @available ( macOS 11 . 0 , * )
44
42
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
45
43
public struct CannotBackDeployStruct {
46
- @available ( macOS 11 . 0 , * )
47
44
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' must not be used on stored properties}}
48
45
public var cannotBackDeployStoredProperty : Int = 83
49
46
50
- @available ( macOS 11 . 0 , * )
51
47
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' must not be used on stored properties}}
52
48
public lazy var cannotBackDeployLazyStoredProperty : Int = 15
53
49
}
54
50
55
- @available ( macOS 11 . 0 , * )
56
51
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
57
52
public enum CannotBackDeployEnum {
58
- @available ( macOS 11 . 0 , * )
59
53
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
60
54
case cannotBackDeployEnumCase
61
55
}
62
56
63
- @available ( macOS 11 . 0 , * )
64
57
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' must not be used on stored properties}}
65
58
public var cannotBackDeployTopLevelVar = 79
66
59
67
- @available ( macOS 11 . 0 , * )
68
60
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
69
61
extension TopLevelStruct { }
70
62
71
63
// MARK: - Incompatible declarations
72
64
73
- @available ( macOS 11 . 0 , * )
74
65
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' may not be used on fileprivate declarations}}
75
66
fileprivate func filePrivateFunc( ) { }
76
67
77
- @available ( macOS 11 . 0 , * )
78
68
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' may not be used on private declarations}}
79
69
private func privateFunc( ) { }
80
70
81
- @available ( macOS 11 . 0 , * )
82
71
@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' may not be used on internal declarations}}
83
72
internal func internalFunc( ) { }
84
73
@@ -130,27 +119,21 @@ public func transparentFunc() {}
130
119
131
120
// MARK: - Attribute parsing
132
121
133
- @available ( macOS 11 . 0 , * )
134
122
@_backDeploy ( macOS 12 . 0 , unknownOS 1 . 0 ) // expected-warning {{unknown platform 'unknownOS' for attribute '@_backDeploy'}}
135
123
public func unknownOSFunc( ) { }
136
124
137
- @available ( macOS 11 . 0 , * )
138
125
@_backDeploy ( @) // expected-error {{expected platform in '@_backDeploy' attribute}}
139
126
public func badPlatformFunc1( ) { }
140
127
141
- @available ( macOS 11 . 0 , * )
142
128
@_backDeploy ( @ 12.0 ) // expected-error {{expected platform in '@_backDeploy' attribute}}
143
129
public func badPlatformFunc2( ) { }
144
130
145
- @available ( macOS 11 . 0 , * )
146
131
@_backDeploy ( macOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
147
132
public func missingVersionFunc1( ) { }
148
133
149
- @available ( macOS 11 . 0 , * )
150
134
@_backDeploy ( macOS 12 . 0 , iOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
151
135
public func missingVersionFunc2( ) { }
152
136
153
- @available ( macOS 11 . 0 , * )
154
137
@_backDeploy ( macOS, iOS) // expected-error 2{{expected version number in '@_backDeploy' attribute}}
155
138
public func missingVersionFunc3( ) { }
156
139
@@ -174,14 +157,11 @@ public func trailingWildcardFunc() {}
174
157
@_backDeploy ( macOS 12 . 0 , * , iOS 15 . 0 ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
175
158
public func embeddedWildcardFunc( ) { }
176
159
177
- @available ( macOS 11 . 0 , * )
178
160
@_backDeploy ( ) // expected-error {{expected at least one platform version in '@_backDeploy' attribute}}
179
161
public func zeroPlatformVersionsFunc( ) { }
180
162
181
- @available ( macOS 11 . 0 , * )
182
163
@_backDeploy // expected-error {{expected '(' in '_backDeploy' attribute}}
183
164
public func expectedLeftParenFunc( ) { }
184
165
185
- @available ( macOS 11 . 0 , * )
186
166
@_backDeploy ( macOS 12 . 0 // expected-note {{to match this opening '('}}
187
167
public func expectedRightParenFunc( ) { } // expected-error {{expected ')' in '@_backDeploy' argument list}}
0 commit comments