Skip to content

Commit 7b9b9b8

Browse files
committed
NFC: Remove unnecessary @available clutter from @_backDeploy tests where higher precedence diagnostics cause availability checks to be skipped.
1 parent e39c550 commit 7b9b9b8

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

test/attr/attr_backDeploy.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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}}
4140
public class CannotBackDeployClass {}
4241

43-
@available(macOS 11.0, *)
4442
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
4543
public 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}}
5752
public 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}}
6558
public var cannotBackDeployTopLevelVar = 79
6659

67-
@available(macOS 11.0, *)
6860
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
6961
extension 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}}
7566
fileprivate func filePrivateFunc() {}
7667

77-
@available(macOS 11.0, *)
7868
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' may not be used on private declarations}}
7969
private func privateFunc() {}
8070

81-
@available(macOS 11.0, *)
8271
@_backDeploy(macOS 12.0) // expected-error {{'@_backDeploy' may not be used on internal declarations}}
8372
internal 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'}}
135123
public func unknownOSFunc() {}
136124

137-
@available(macOS 11.0, *)
138125
@_backDeploy(@) // expected-error {{expected platform in '@_backDeploy' attribute}}
139126
public func badPlatformFunc1() {}
140127

141-
@available(macOS 11.0, *)
142128
@_backDeploy(@ 12.0) // expected-error {{expected platform in '@_backDeploy' attribute}}
143129
public func badPlatformFunc2() {}
144130

145-
@available(macOS 11.0, *)
146131
@_backDeploy(macOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
147132
public func missingVersionFunc1() {}
148133

149-
@available(macOS 11.0, *)
150134
@_backDeploy(macOS 12.0, iOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
151135
public func missingVersionFunc2() {}
152136

153-
@available(macOS 11.0, *)
154137
@_backDeploy(macOS, iOS) // expected-error 2{{expected version number in '@_backDeploy' attribute}}
155138
public 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}}
175158
public func embeddedWildcardFunc() {}
176159

177-
@available(macOS 11.0, *)
178160
@_backDeploy() // expected-error {{expected at least one platform version in '@_backDeploy' attribute}}
179161
public func zeroPlatformVersionsFunc() {}
180162

181-
@available(macOS 11.0, *)
182163
@_backDeploy // expected-error {{expected '(' in '_backDeploy' attribute}}
183164
public func expectedLeftParenFunc() {}
184165

185-
@available(macOS 11.0, *)
186166
@_backDeploy(macOS 12.0 // expected-note {{to match this opening '('}}
187167
public func expectedRightParenFunc() {} // expected-error {{expected ')' in '@_backDeploy' argument list}}

0 commit comments

Comments
 (0)