Skip to content

Commit 9b91b88

Browse files
committed
[test] ArrayBridge: Add missing availability checks
Welp, the bogus precondition that was fixed in swiftlang#37960 indeed doesn't entirely deploy back to previous OSes. This makes sense -- bridging is generally not specialized. rdar://82125353
1 parent a723e6d commit 9b91b88

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/stdlib/ArrayBridge.swift.gyb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,10 @@ tests.test("rdar://problem/27905230") {
485485
}
486486

487487
tests.test("verbatimBridged/Base/withUnsafeBufferPointer") {
488+
// https://bugs.swift.org/browse/SR-14663
489+
// This tests a bad precondition that was fixed in
490+
// https://github.com/apple/swift/pull/37960
491+
guard #available(macOS 12, iOS 15, watchOS 8, tvOS 15, *) else { return }
488492
let a = NSArray(array: [Base(0), Base(1), Base(2), Base(3)])
489493
let b = a as! [Base]
490494
let success: Bool = b.withUnsafeBufferPointer { buffer in
@@ -499,8 +503,11 @@ tests.test("verbatimBridged/Base/withUnsafeBufferPointer") {
499503
expectTrue(success)
500504
}
501505

502-
// https://bugs.swift.org/browse/SR-14663
503506
tests.test("verbatimBridged/AnyObject/withUnsafeBufferPointer") {
507+
// https://bugs.swift.org/browse/SR-14663
508+
// This tests a bad precondition that was fixed in
509+
// https://github.com/apple/swift/pull/37960
510+
guard #available(macOS 12, iOS 15, watchOS 8, tvOS 15, *) else { return }
504511
let a = NSArray(array: [Base(0), Base(1), Base(2), Base(3)])
505512
let b = a as [AnyObject]
506513
let success: Bool = b.withUnsafeBufferPointer { buffer in

0 commit comments

Comments
 (0)