Skip to content

Commit 803b96d

Browse files
committed
---
yaml --- r: 319343 b: refs/heads/master-rebranch c: 85d508e h: refs/heads/master i: 319341: 760ff8f 319339: 49a8ade 319335: 34bc34a 319327: 888e0ab
1 parent 4b2b490 commit 803b96d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: 231c36c4d7c91ba4622c6a1c242cc327c9aec8b5
1460+
refs/heads/master-rebranch: 85d508e97b4c502dbae11da68738d55df1764510

branches/master-rebranch/stdlib/public/Darwin/Foundation/NSValue.swift.gyb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ ${ ObjectiveCBridgeableImplementationForNSValue("CGSize") }
2424
${ ObjectiveCBridgeableImplementationForNSValue("CGAffineTransform") }
2525

2626
extension NSValue {
27+
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
2728
public func value<StoredType>(of type: StoredType.Type) -> StoredType? {
2829
if StoredType.self is AnyObject.Type {
2930
let encoding = String(cString: objCType)
@@ -41,13 +42,9 @@ extension NSValue {
4142
}
4243
let allocated = UnsafeMutablePointer<StoredType>.allocate(capacity: 1)
4344
defer { allocated.deallocate() }
44-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
45-
getValue(allocated, size: storedSize)
46-
} else {
47-
getValue(allocated)
48-
}
45+
getValue(allocated, size: storedSize)
4946
return allocated.pointee
5047
}
5148
return nil
5249
}
53-
}
50+
}

branches/master-rebranch/test/stdlib/NSValueBridging.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ nsValueBridging.test("NSValue can only be cast back to its original type") {
9292
}
9393

9494
nsValueBridging.test("NSValue fetching method should be able to convert constructed values safely") {
95+
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else { return }
96+
9597
let range = NSRange(location: 17, length: 38)
9698
let value = NSValue(range: range)
9799
expectEqual(value.value(of: NSRange.self)?.location, range.location)

0 commit comments

Comments
 (0)