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/conformance_availability_warn.swift
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -19,28 +19,28 @@ public struct HasAvailableConformance1 {}
19
19
@available(macOS 100,*)
20
20
extensionHasAvailableConformance1:Horse{}
21
21
22
-
// These availability violations are warnings because this test does not
23
-
// pass the -enable-conformance-availability-errors flag. See the other
24
-
// test case in test/Sema/conformance_availability.swift for the same
25
-
// example but with this flag.
22
+
// These availability violations are warnings because this test does not pass
23
+
// -swift-version 6.
24
+
// See the other test case in test/Sema/conformance_availability.swift for the
25
+
// same example but with -swift-version 6.
26
26
27
27
func passAvailableConformance1(x:HasAvailableConformance1){ // expected-note 6{{add @available attribute to enclosing global function}}
28
-
takesHorse(x) // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer}}
28
+
takesHorse(x) // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer; this is an error in Swift 6}}
29
29
// expected-note@-1 {{add 'if #available' version check}}
30
30
31
-
takesHorseExistential(x) // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer}}
31
+
takesHorseExistential(x) // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer; this is an error in Swift 6}}
32
32
// expected-note@-1 {{add 'if #available' version check}}
33
33
34
-
x.giddyUp() // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer}}
34
+
x.giddyUp() // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer; this is an error in Swift 6}}
35
35
// expected-note@-1 {{add 'if #available' version check}}
36
36
37
-
_ = x.isGalloping // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer}}
37
+
_ = x.isGalloping // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer; this is an error in Swift 6}}
38
38
// expected-note@-1 {{add 'if #available' version check}}
39
39
40
-
_ =x[keyPath: \.isGalloping] // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer}}
40
+
_ =x[keyPath: \.isGalloping] // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer; this is an error in Swift 6}}
41
41
// expected-note@-1 {{add 'if #available' version check}}
42
42
43
-
_ = UsesHorse<HasAvailableConformance1>.self // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer}}
43
+
_ = UsesHorse<HasAvailableConformance1>.self // expected-warning {{conformance of 'HasAvailableConformance1' to 'Horse' is only available in macOS 100 or newer; this is an error in Swift 6}}
44
44
// expected-note@-1 {{add 'if #available' version check}}
45
45
}
46
46
@@ -60,9 +60,9 @@ public struct HasAvailableConformance2 {}
60
60
extensionHasAvailableConformance2:Horse{} // expected-note 6 {{conformance of 'HasAvailableConformance2' to 'Horse' has been explicitly marked unavailable here}}
61
61
62
62
// Some availability diagnostics become warnings in Swift 5 mode without
63
-
// -enable-conformance-availability-errors because they were incorrectly
64
-
// accepted before and rejecting them would break source compatibility. Others
65
-
// are unaffected because they have always been rejected.
63
+
// because they were incorrectly accepted before and rejecting them would break
64
+
// source compatibility. Others are unaffected because they have always been
0 commit comments