Skip to content

Commit 88e0a87

Browse files
authored
Merge pull request swiftlang#39327 from lorentey/add-missing-availability-check
[test] ArrayBridge: Add missing availability checks
2 parents de015c6 + 9b91b88 commit 88e0a87

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)