     return withUnsafeBufferOfObjects {
       objects in
       _precondition(
-        _isValidArrayIndex(range.location, objects.count),
+        _isValidArrayIndex(range.location, count: objects.count),
         "Array index out of range")
 
       _precondition(
         _isValidArrayIndex(
-          range.location + range.length, objects.count),
+          range.location + range.length, count: objects.count),
         "Array index out of range")
 
       // These objects are "returned" at +0, so treat them as values to

}

// Implement the APIs required by NSArray 
extension _SwiftNativeNSArrayWithContiguousStorage: _NSArrayCore {
  @objc internal var count: Int {
    return withUnsafeBufferOfObjects { $0.count }
  }

  @objc(objectAtIndex:) internal func objectAt(index: Int) -> AnyObject {
    return withUnsafeBufferOfObjects {
      objects in
      _precondition(
        _isValidArraySubscript(index, objects.count),
        "Array index out of range")
      return objects[index]
    }

/// Returns `true` iff the given `index` is valid as a position, i.e. `0
/// ≤ index ≤ count`.
@_transparent
internal func _isValidArrayIndex(index: Int, count: Int) -> Bool {
  return (index >= 0) && (index <= count)
}

/// Returns `true` iff the given `index` is valid for subscripting, i.e.
/// `0 ≤ index < count`.
@_transparent
internal func _isValidArraySubscript(index: Int, count: Int) -> Bool {
  return (index >= 0) && (index < count)
}

/// An `NSArray` with Swift-native reference counting and contiguous
/// storage.
internal class _SwiftNativeNSArrayWithContiguousStorage
  : _SwiftNativeNSArray { // Provides NSArray inheritance and native refcounting

  // Operate on our contiguous storage
