@@ -36,49 +36,38 @@ public class TopLevelClass {
3636
3737// MARK: - Unsupported declaration types
3838
39- @available ( macOS 11 . 0 , * )
4039@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
4140public class CannotBackDeployClass { }
4241
43- @available ( macOS 11 . 0 , * )
4442@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
4543public struct CannotBackDeployStruct {
46- @available ( macOS 11 . 0 , * )
4744 @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' must not be used on stored properties}}
4845 public var cannotBackDeployStoredProperty : Int = 83
4946
50- @available ( macOS 11 . 0 , * )
5147 @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' must not be used on stored properties}}
5248 public lazy var cannotBackDeployLazyStoredProperty : Int = 15
5349}
5450
55- @available ( macOS 11 . 0 , * )
5651@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
5752public enum CannotBackDeployEnum {
58- @available ( macOS 11 . 0 , * )
5953 @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
6054 case cannotBackDeployEnumCase
6155}
6256
63- @available ( macOS 11 . 0 , * )
6457@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' must not be used on stored properties}}
6558public var cannotBackDeployTopLevelVar = 79
6659
67- @available ( macOS 11 . 0 , * )
6860@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
6961extension TopLevelStruct { }
7062
7163// MARK: - Incompatible declarations
7264
73- @available ( macOS 11 . 0 , * )
7465@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' may not be used on fileprivate declarations}}
7566fileprivate func filePrivateFunc( ) { }
7667
77- @available ( macOS 11 . 0 , * )
7868@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' may not be used on private declarations}}
7969private func privateFunc( ) { }
8070
81- @available ( macOS 11 . 0 , * )
8271@_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' may not be used on internal declarations}}
8372internal func internalFunc( ) { }
8473
@@ -130,27 +119,21 @@ public func transparentFunc() {}
130119
131120// MARK: - Attribute parsing
132121
133- @available ( macOS 11 . 0 , * )
134122@_backDeploy ( macOS 12 . 0 , unknownOS 1 . 0 ) // expected-warning {{unknown platform 'unknownOS' for attribute '@_backDeploy'}}
135123public func unknownOSFunc( ) { }
136124
137- @available ( macOS 11 . 0 , * )
138125@_backDeploy ( @) // expected-error {{expected platform in '@_backDeploy' attribute}}
139126public func badPlatformFunc1( ) { }
140127
141- @available ( macOS 11 . 0 , * )
142128@_backDeploy ( @ 12.0 ) // expected-error {{expected platform in '@_backDeploy' attribute}}
143129public func badPlatformFunc2( ) { }
144130
145- @available ( macOS 11 . 0 , * )
146131@_backDeploy ( macOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
147132public func missingVersionFunc1( ) { }
148133
149- @available ( macOS 11 . 0 , * )
150134@_backDeploy ( macOS 12 . 0 , iOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
151135public func missingVersionFunc2( ) { }
152136
153- @available ( macOS 11 . 0 , * )
154137@_backDeploy ( macOS, iOS) // expected-error 2{{expected version number in '@_backDeploy' attribute}}
155138public func missingVersionFunc3( ) { }
156139
@@ -174,14 +157,11 @@ public func trailingWildcardFunc() {}
174157@_backDeploy ( macOS 12 . 0 , * , iOS 15 . 0 ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
175158public func embeddedWildcardFunc( ) { }
176159
177- @available ( macOS 11 . 0 , * )
178160@_backDeploy ( ) // expected-error {{expected at least one platform version in '@_backDeploy' attribute}}
179161public func zeroPlatformVersionsFunc( ) { }
180162
181- @available ( macOS 11 . 0 , * )
182163@_backDeploy // expected-error {{expected '(' in '_backDeploy' attribute}}
183164public func expectedLeftParenFunc( ) { }
184165
185- @available ( macOS 11 . 0 , * )
186166@_backDeploy ( macOS 12 . 0 // expected-note {{to match this opening '('}}
187167public func expectedRightParenFunc( ) { } // expected-error {{expected ')' in '@_backDeploy' argument list}}
0 commit comments