You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Sema/availability_swiftui.swift
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,3 +13,4 @@ class AnyColorBox: LessAvailable {} // Ok, exception specifically for AnyColorBo
13
13
@available(macOS 10.15,*)
14
14
@usableFromInline
15
15
classOtherClass:LessAvailable{} // expected-error {{'LessAvailable' is only available in macOS 11 or newer; clients of 'SwiftUI' may have a lower deployment target}}
16
+
// expected-note @-1 {{change the @available attribute of the class on macOS from 10.15 to 11}} {{13:18-23=11}}
varpropWithInitializer10_52:Int=globalFuncAvailableOn10_52() // expected-error {{'globalFuncAvailableOn10_52()' is only available in macOS 10.52 or newer}}
414
+
// expected-note@-1 {{change the @available attribute of the class on macOS from 10.51 to 10.52}} {{409:29-34=10.52}}
lazy varlazyPropWithInitializer10_52:Int=globalFuncAvailableOn10_52() // expected-error {{'globalFuncAvailableOn10_52()' is only available in macOS 10.52 or newer}}
419
+
// expected-note@-1 {{change the @available attribute of the class on macOS from 10.51 to 10.52}} {{409:29-34=10.52}}
case WithAvailableByEnumElementPayload1(p :EnumIntroducedOn10_52), WithAvailableByEnumElementPayload2(p :EnumIntroducedOn10_52)
541
546
542
547
case WithPotentiallyUnavailablePayload(p :EnumIntroducedOn10_52) // expected-error {{'EnumIntroducedOn10_52' is only available in macOS 10.52 or newer}}
548
+
// expected-note@-1 {{change the @available attribute of the enum on macOS from 10.51 to 10.52}} {{527:29-34=10.52}}
543
549
544
550
case WithPotentiallyUnavailablePayload1(p :EnumIntroducedOn10_52), WithPotentiallyUnavailablePayload2(p :EnumIntroducedOn10_52) // expected-error 2{{'EnumIntroducedOn10_52' is only available in macOS 10.52 or newer}}
545
-
551
+
// expected-note@-1 2{{change the @available attribute of the enum on macOS from 10.51 to 10.52}} {{527:29-34=10.52}}
552
+
546
553
@available(OSX, unavailable)
547
554
case WithPotentiallyUnavailablePayload3(p :EnumIntroducedOn10_52)
548
555
}
@@ -878,18 +885,20 @@ class SubWithLargerMemberAvailability : SuperWithLimitedMemberAvailability {
878
885
overridefunc someMethod(){
879
886
super.someMethod() // expected-error {{'someMethod()' is only available in macOS 10.51 or newer}}
880
887
// expected-note@-1 {{add 'if #available' version check}}
881
-
888
+
// expected-note@-2 {{change the @available attribute of the instance method on macOS from 10.9 to 10.51}} {{884:31-35=10.51}}
889
+
882
890
if #available(OSX 10.51,*){
883
891
super.someMethod()
884
892
}
885
893
}
886
894
887
895
@available(OSX, introduced:10.9)
888
896
overridevarsomeProperty:Int{
889
-
get{
897
+
get{
890
898
let _ = super.someProperty // expected-error {{'someProperty' is only available in macOS 10.51 or newer}}
891
-
// expected-note@-1 {{add 'if #available' version check}}
892
-
899
+
// expected-note@-1 {{add 'if #available' version check}}
900
+
// expected-note@-2 {{change the @available attribute of the pattern binding on macOS from 10.9 to 10.51}} {{895:31-35=10.51}}
protocolProtocolAvailableOn10_9InheritingFromProtocolAvailableOn10_51:ProtocolAvailableOn10_51{ // expected-error {{'ProtocolAvailableOn10_51' is only available in macOS 10.51 or newer}}
973
+
// expected-note@-1 {{change the @available attribute of the protocol on macOS from 10.9 to 10.51}} {{971:29-33=10.51}}
classSubclassAvailableOn10_9OfClassAvailableOn10_51:ClassAvailableOn10_51{ // expected-error {{'ClassAvailableOn10_51' is only available in macOS 10.51 or newer}}
986
+
// expected-note@-1 {{change the @available attribute of the class on macOS from 10.9 to 10.51}} {{984:29-33=10.51}}
classSubclassAvailableOn10_9OfClassAvailableOn10_51AlsoAdoptingProtocolAvailableOn10_51:ClassAvailableOn10_51,ProtocolAvailableOn10_51{ // expected-error {{'ClassAvailableOn10_51' is only available in macOS 10.51 or newer}}
1011
+
// expected-note@-1 {{change the @available attribute of the class on macOS from 10.9 to 10.51}} {{1009:29-33=10.51}}
1000
1012
}
1001
1013
1002
1014
classSomeGenericClass<T>{}
1003
1015
1004
1016
@available(OSX, introduced:10.9)
1005
1017
classSubclassAvailableOn10_9OfSomeGenericClassOfProtocolAvailableOn10_51:SomeGenericClass<ProtocolAvailableOn10_51>{ // expected-error {{'ProtocolAvailableOn10_51' is only available in macOS 10.51 or newer}}
1018
+
// expected-note@-1 {{change the @available attribute of the class on macOS from 10.9 to 10.51}} {{1016:29-33=10.51}}
_ = o99_51.returns99_52Introduced99_52() // expected-error {{'returns99_52Introduced99_52()' is only available in macOS 99.52 or newer}}
36
36
// expected-note@-1 {{add 'if #available' version check}}
37
+
// expected-note@-2 {{change the @available attribute of the global function on macOS from 99.51 to 99.52}} {{26:29-34=99.52}}
37
38
38
39
_ =OtherIntroduced99_52()
39
40
// expected-error@-1 {{'OtherIntroduced99_52' is only available in macOS 99.52 or newer}}
40
41
// expected-note@-2 {{add 'if #available' version check}}
42
+
// expected-note@-3 {{change the @available attribute of the global function on macOS from 99.51 to 99.52}} {{26:29-34=99.52}}
41
43
42
44
o99_51.extensionMethodOnOtherIntroduced99_51AvailableOn99_52() // expected-error {{'extensionMethodOnOtherIntroduced99_51AvailableOn99_52()' is only available in macOS 99.52 or newer}}
43
45
// expected-note@-1 {{add 'if #available' version check}}
46
+
// expected-note@-2 {{change the @available attribute of the global function on macOS from 99.51 to 99.52}} {{26:29-34=99.52}}
44
47
45
48
_ =OtherIntroduced99_51.NestedIntroduced99_52()
46
49
// expected-error@-1 {{'NestedIntroduced99_52' is only available in macOS 99.52 or newer}}
47
50
// expected-note@-2 {{add 'if #available' version check}}
51
+
// expected-note@-3 {{change the @available attribute of the global function on macOS from 99.51 to 99.52}} {{26:29-34=99.52}}
48
52
}
49
53
50
54
@available(OSX, introduced:99.52)
@@ -55,7 +59,7 @@ func useFromOtherOn99_52() {
55
59
_ = n99_52.returns99_52()
56
60
_ = n99_52.returns99_53() // expected-error {{'returns99_53()' is only available in macOS 99.53 or newer}}
57
61
// expected-note@-1 {{add 'if #available' version check}}
58
-
62
+
// expected-note@-2 {{change the @available attribute of the global function on macOS from 99.52 to 99.53}} {{54:29-34=99.53}}
59
63
// This will trigger validation of the global in availability_in_multi_other.swift
0 commit comments