|
3 | 3 | // validate declarations when resolving declaration signatures. |
4 | 4 | // This file relies on the minimum deployment target for OS X being 10.9. |
5 | 5 |
|
6 | | -@available(OSX, introduced: 10.52) |
7 | | -private class PrivateIntroduced10_52 { } |
| 6 | +@available(OSX, introduced: 99.52) |
| 7 | +private class PrivateIntroduced99_52 { } |
8 | 8 |
|
9 | 9 | class OtherIntroduced10_9 { } |
10 | 10 |
|
11 | | -@available(OSX, introduced: 10.51) |
12 | | -class OtherIntroduced10_51 { |
13 | | - func uses10_52() { |
| 11 | +@available(OSX, introduced: 99.51) |
| 12 | +class OtherIntroduced99_51 { |
| 13 | + func uses99_52() { |
14 | 14 | // If this were the primary file then the below would emit an error, because |
15 | | - // PrivateIntroduced10_53 is not available on 10.52. But since we only |
| 15 | + // PrivateIntroduced99_53 is not available on 99.52. But since we only |
16 | 16 | // run the first pass of the type checker on these declarations, |
17 | 17 | // the body is not checked. |
18 | | - _ = PrivateIntroduced10_52() |
| 18 | + _ = PrivateIntroduced99_52() |
19 | 19 | } |
20 | 20 |
|
21 | | - // This method uses a 10_52 only type in its signature, so validating |
| 21 | + // This method uses a 99_52 only type in its signature, so validating |
22 | 22 | // the declaration should produce an availability error |
23 | | - func returns10_52() -> OtherIntroduced10_52 { // expected-error {{'OtherIntroduced10_52' is only available in macOS 10.52 or newer}} |
| 23 | + func returns99_52() -> OtherIntroduced99_52 { // expected-error {{'OtherIntroduced99_52' is only available in macOS 99.52 or newer}} |
24 | 24 | // expected-note@-1 {{add @available attribute to enclosing instance method}} |
25 | 25 |
|
26 | 26 | // Body is not type checked (by design) so no error is expected for unavailable type used in return. |
27 | | - return OtherIntroduced10_52() |
| 27 | + return OtherIntroduced99_52() |
28 | 28 | } |
29 | 29 |
|
30 | | - @available(OSX, introduced: 10.52) |
31 | | - func returns10_52Introduced10_52() -> OtherIntroduced10_52 { |
32 | | - return OtherIntroduced10_52() |
| 30 | + @available(OSX, introduced: 99.52) |
| 31 | + func returns99_52Introduced99_52() -> OtherIntroduced99_52 { |
| 32 | + return OtherIntroduced99_52() |
33 | 33 | } |
34 | 34 |
|
35 | | - func takes10_52(o: OtherIntroduced10_52) { |
| 35 | + func takes99_52(o: OtherIntroduced99_52) { |
36 | 36 | } |
37 | 37 |
|
38 | | - @available(OSX, introduced: 10.52) |
39 | | - func takes10_52Introduced10_52(o: OtherIntroduced10_52) { |
| 38 | + @available(OSX, introduced: 99.52) |
| 39 | + func takes99_52Introduced99_52(o: OtherIntroduced99_52) { |
40 | 40 | } |
41 | 41 |
|
42 | | - var propOf10_52: OtherIntroduced10_52 = |
| 42 | + var propOf99_52: OtherIntroduced99_52 = |
43 | 43 |
|
44 | 44 |
|
45 | | - OtherIntroduced10_52() // We don't expect an error here because the initializer is not type checked (by design). |
| 45 | + OtherIntroduced99_52() // We don't expect an error here because the initializer is not type checked (by design). |
46 | 46 |
|
47 | | - @available(OSX, introduced: 10.52) |
48 | | - var propOf10_52Introduced10_52: OtherIntroduced10_52 = OtherIntroduced10_52() |
| 47 | + @available(OSX, introduced: 99.52) |
| 48 | + var propOf99_52Introduced99_52: OtherIntroduced99_52 = OtherIntroduced99_52() |
49 | 49 |
|
50 | | - @available(OSX, introduced: 10.52) |
51 | | - class NestedIntroduced10_52 : OtherIntroduced10_52 { |
52 | | - override func returns10_52() -> OtherIntroduced10_52 { |
| 50 | + @available(OSX, introduced: 99.52) |
| 51 | + class NestedIntroduced99_52 : OtherIntroduced99_52 { |
| 52 | + override func returns99_52() -> OtherIntroduced99_52 { |
53 | 53 | } |
54 | 54 |
|
55 | | - @available(OSX, introduced: 10.53) |
56 | | - func returns10_53() -> OtherIntroduced10_53 { |
| 55 | + @available(OSX, introduced: 99.53) |
| 56 | + func returns99_53() -> OtherIntroduced99_53 { |
57 | 57 | } |
58 | 58 | } |
59 | 59 | } |
60 | 60 |
|
61 | | -@available(OSX, introduced: 10.51) |
62 | | -class SubOtherIntroduced10_51 : OtherIntroduced10_51 { |
| 61 | +@available(OSX, introduced: 99.51) |
| 62 | +class SubOtherIntroduced99_51 : OtherIntroduced99_51 { |
63 | 63 | } |
64 | 64 |
|
65 | | -@available(OSX, introduced: 10.52) |
66 | | -class OtherIntroduced10_52 : OtherIntroduced10_51 { |
| 65 | +@available(OSX, introduced: 99.52) |
| 66 | +class OtherIntroduced99_52 : OtherIntroduced99_51 { |
67 | 67 | } |
68 | 68 |
|
69 | | -extension OtherIntroduced10_51 { |
| 69 | +extension OtherIntroduced99_51 { |
70 | 70 | } |
71 | 71 |
|
72 | 72 | extension OtherIntroduced10_9 { |
73 | | - @available(OSX, introduced: 10.51) |
74 | | - func extensionMethodOnOtherIntroduced10_9AvailableOn10_51(_ p: OtherIntroduced10_51) { } |
| 73 | + @available(OSX, introduced: 99.51) |
| 74 | + func extensionMethodOnOtherIntroduced10_9AvailableOn99_51(_ p: OtherIntroduced99_51) { } |
75 | 75 | } |
76 | 76 |
|
77 | | -@available(OSX, introduced: 10.51) |
78 | | -extension OtherIntroduced10_51 { |
79 | | - func extensionMethodOnOtherIntroduced10_51() { } |
| 77 | +@available(OSX, introduced: 99.51) |
| 78 | +extension OtherIntroduced99_51 { |
| 79 | + func extensionMethodOnOtherIntroduced99_51() { } |
80 | 80 |
|
81 | | - @available(OSX, introduced: 10.52) |
82 | | - func extensionMethodOnOtherIntroduced10_51AvailableOn10_52() { } |
| 81 | + @available(OSX, introduced: 99.52) |
| 82 | + func extensionMethodOnOtherIntroduced99_51AvailableOn99_52() { } |
83 | 83 | } |
84 | 84 |
|
85 | | -@available(OSX, introduced: 10.53) |
86 | | -class OtherIntroduced10_53 { |
| 85 | +@available(OSX, introduced: 99.53) |
| 86 | +class OtherIntroduced99_53 { |
87 | 87 | } |
88 | 88 |
|
89 | | -var globalFromOtherOn10_52 : OtherIntroduced10_52? = nil // expected-error {{'OtherIntroduced10_52' is only available in macOS 10.52 or newer}} |
| 89 | +var globalFromOtherOn99_52 : OtherIntroduced99_52? = nil // expected-error {{'OtherIntroduced99_52' is only available in macOS 99.52 or newer}} |
90 | 90 | // expected-note@-1 {{add @available attribute to enclosing var}} |
0 commit comments