Skip to content

Commit 209c1d7

Browse files
authored
Merge pull request #24301 from jckarter/opaque-execution-test-availability
Correct availability for opaque type execution test.
2 parents 72701a1 + f49bc6c commit 209c1d7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

4+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
45
protocol P {
56
associatedtype AT
67
func foo() -> AT
78
}
89

10+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
911
struct Adapter<T: P>: P {
1012
var inner: T
13+
14+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
1115
func foo() -> some P {
1216
return inner
1317
}
1418
}
1519

20+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
1621
extension P {
22+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
1723
func foo() -> some P {
1824
return Adapter(inner: self)
1925
}
2026
}
2127

28+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
2229
func getPAT<T: P>(_: T.Type) -> Any.Type {
2330
return T.AT.self
2431
}
2532

33+
@available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *)
2634
extension Int: P { }
2735

28-
// CHECK: Adapter<Int>
29-
print(getPAT(Int.self))
36+
// CHECK: {{Adapter<Int>|too old}}
37+
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
38+
print(getPAT(Int.self))
39+
} else {
40+
print("i'm getting too old for this sh")
41+
}

0 commit comments

Comments
 (0)