2
2
3
3
// MARK: - Valid declarations
4
4
5
- @available ( macOS 12 . 0 , * )
6
- @_backDeploy ( macOS 11 . 0 )
5
+ @available ( macOS 11 . 0 , * )
6
+ @_backDeploy ( macOS 12 . 0 )
7
7
public func backDeployedTopLevelFunc( ) { }
8
8
9
9
// FIXME(backDeploy): Availability macros should be supported
10
10
11
11
public class TopLevelClass {
12
- @available ( macOS 12 . 0 , * )
13
- @_backDeploy ( macOS 11 . 0 )
12
+ @available ( macOS 11 . 0 , * )
13
+ @_backDeploy ( macOS 12 . 0 )
14
14
public func backDeployedMemberFunc( ) { }
15
15
16
16
// FIXME(backDeploy): Computed properties should be supported
17
- @available ( macOS 12 . 0 , * )
18
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
17
+ @available ( macOS 11 . 0 , * )
18
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
19
19
public var backDeployedComputedProperty : Int { 98 }
20
20
21
21
// FIXME(backDeploy): Subscripts should be supported
22
- @available ( macOS 12 . 0 , * )
23
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
22
+ @available ( macOS 11 . 0 , * )
23
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
24
24
subscript( index: Int ) -> Int {
25
25
get { return 1 }
26
26
set ( newValue) { }
@@ -29,28 +29,28 @@ public class TopLevelClass {
29
29
30
30
// MARK: - Unsupported declaration types
31
31
32
- @available ( macOS 12 . 0 , * )
33
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
32
+ @available ( macOS 11 . 0 , * )
33
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
34
34
public class CannotBackDeployClass {
35
- @available ( macOS 12 . 0 , * )
36
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
35
+ @available ( macOS 11 . 0 , * )
36
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
37
37
public var cannotBackDeploystoredProperty : Int = 83
38
38
}
39
39
40
- @available ( macOS 12 . 0 , * )
41
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
40
+ @available ( macOS 11 . 0 , * )
41
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
42
42
public struct CannotBackDeployStruct { }
43
43
44
- @available ( macOS 12 . 0 , * )
45
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
44
+ @available ( macOS 11 . 0 , * )
45
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
46
46
public enum CannotBackDeployEnum {
47
- @available ( macOS 12 . 0 , * )
48
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
47
+ @available ( macOS 11 . 0 , * )
48
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
49
49
case cannotBackDeployEnumCase
50
50
}
51
51
52
- @available ( macOS 12 . 0 , * )
53
- @_backDeploy ( macOS 11 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
52
+ @available ( macOS 11 . 0 , * )
53
+ @_backDeploy ( macOS 12 . 0 ) // expected-error {{'@_backDeploy' attribute cannot be applied to this declaration}}
54
54
public var cannotBackDeployTopLevelVar = 79
55
55
56
56
// MARK: - Incompatible declarations
@@ -62,69 +62,69 @@ public var cannotBackDeployTopLevelVar = 79
62
62
63
63
// MARK: - Attribute parsing
64
64
65
- @available ( macOS 12 . 0 , * )
66
- @_backDeploy ( macOS 11 . 0 , unknownOS 1 . 0 ) // expected-warning {{unknown platform 'unknownOS' for attribute '@_backDeploy'}}
65
+ @available ( macOS 11 . 0 , * )
66
+ @_backDeploy ( macOS 12 . 0 , unknownOS 1 . 0 ) // expected-warning {{unknown platform 'unknownOS' for attribute '@_backDeploy'}}
67
67
public func unknownOSFunc( ) { }
68
68
69
- @available ( macOS 12 . 0 , * )
69
+ @available ( macOS 11 . 0 , * )
70
70
@_backDeploy ( @) // expected-error {{expected platform in '@_backDeploy' attribute}}
71
71
public func badPlatformFunc1( ) { }
72
72
73
- @available ( macOS 12 . 0 , * )
73
+ @available ( macOS 11 . 0 , * )
74
74
@_backDeploy ( @ 12.0 ) // expected-error {{expected platform in '@_backDeploy' attribute}}
75
75
public func badPlatformFunc2( ) { }
76
76
77
- @available ( macOS 12 . 0 , * )
77
+ @available ( macOS 11 . 0 , * )
78
78
@_backDeploy ( macOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
79
79
public func missingVersionFunc1( ) { }
80
80
81
- @available ( macOS 12 . 0 , * )
82
- @_backDeploy ( macOS 11 . 0 , iOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
81
+ @available ( macOS 11 . 0 , * )
82
+ @_backDeploy ( macOS 12 . 0 , iOS) // expected-error {{expected version number in '@_backDeploy' attribute}}
83
83
public func missingVersionFunc2( ) { }
84
84
85
- @available ( macOS 12 . 0 , * )
85
+ @available ( macOS 11 . 0 , * )
86
86
@_backDeploy ( macOS, iOS) // expected-error 2{{expected version number in '@_backDeploy' attribute}}
87
87
public func missingVersionFunc3( ) { }
88
88
89
- @available ( macOS 12 . 0 , * )
90
- @_backDeploy ( macOS 11 . 0 , iOS 14 . 0 , ) // expected-error {{unexpected ',' separator}}
89
+ @available ( macOS 11 . 0 , * )
90
+ @_backDeploy ( macOS 12 . 0 , iOS 14 . 0 , ) // expected-error {{unexpected ',' separator}}
91
91
public func unexpectedSeparatorFunc( ) { }
92
92
93
- @available ( macOS 12 . 0 , * )
94
- @_backDeploy ( macOS 11 . 0 . 1 ) // expected-warning {{'@_backDeploy' only uses major and minor version number}}
93
+ @available ( macOS 11 . 0 , * )
94
+ @_backDeploy ( macOS 12 . 0 . 1 ) // expected-warning {{'@_backDeploy' only uses major and minor version number}}
95
95
public func patchVersionFunc( ) { }
96
96
97
- @available ( macOS 12 . 0 , * )
98
- @_backDeploy ( macOS 11 . 0 , * 9.0 ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
97
+ @available ( macOS 11 . 0 , * )
98
+ @_backDeploy ( macOS 12 . 0 , * 9.0 ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
99
99
public func wildcardWithVersionFunc( ) { }
100
100
101
- @available ( macOS 12 . 0 , * )
102
- @_backDeploy ( macOS 11 . 0 , * ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
101
+ @available ( macOS 11 . 0 , * )
102
+ @_backDeploy ( macOS 12 . 0 , * ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
103
103
public func trailingWildcardFunc( ) { }
104
104
105
- @available ( macOS 12 . 0 , * )
106
- @_backDeploy ( macOS 11 . 0 , * , iOS 14 . 0 ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
105
+ @available ( macOS 11 . 0 , * )
106
+ @_backDeploy ( macOS 12 . 0 , * , iOS 14 . 0 ) // expected-warning {{* as platform name has no effect in '@_backDeploy' attribute}}
107
107
public func embeddedWildcardFunc( ) { }
108
108
109
109
// FIXME(backDeploy): Expect error for duplicate platforms in same attribute
110
- @available ( macOS 12 . 0 , * )
111
- @_backDeploy ( macOS 11 . 0 , macOS 10 . 0 )
110
+ @available ( macOS 11 . 0 , * )
111
+ @_backDeploy ( macOS 12 . 0 , macOS 13 . 0 )
112
112
public func duplicatePlatformsFunc1( ) { }
113
113
114
114
// FIXME(backDeploy): Expect error for duplicate platforms accross multiple attributes
115
- @available ( macOS 12 . 0 , * )
116
- @_backDeploy ( macOS 11 . 0 )
117
- @_backDeploy ( macOS 10 . 0 )
115
+ @available ( macOS 11 . 0 , * )
116
+ @_backDeploy ( macOS 12 . 0 )
117
+ @_backDeploy ( macOS 13 . 0 )
118
118
public func duplicatePlatformsFunc2( ) { }
119
119
120
- @available ( macOS 12 . 0 , * )
120
+ @available ( macOS 11 . 0 , * )
121
121
@_backDeploy ( ) // expected-error {{expected at least one platform version in '@_backDeploy' attribute}}
122
122
public func zeroPlatformVersionsFunc( ) { }
123
123
124
- @available ( macOS 12 . 0 , * )
124
+ @available ( macOS 11 . 0 , * )
125
125
@_backDeploy // expected-error {{expected '(' in '_backDeploy' attribute}}
126
126
public func expectedLeftParenFunc( ) { }
127
127
128
- @available ( macOS 12 . 0 , * )
129
- @_backDeploy ( macOS 11 . 0 // expected-note {{to match this opening '('}}
128
+ @available ( macOS 11 . 0 , * )
129
+ @_backDeploy ( macOS 12 . 0 // expected-note {{to match this opening '('}}
130
130
public func expectedRightParenFunc( ) { } // expected-error {{expected ')' in '@_backDeploy' argument list}}
0 commit comments