@@ -59,13 +59,15 @@ internal var _emptyArrayStorage : _EmptyArrayStorage {
5959 Builtin . addressof ( & _swiftEmptyArrayStorage) )
6060}
6161
62- // FIXME(ABI)#141 : This whole class is a workaround for
63- // <rdar://problem/18560464> Can't override generic method in generic
64- // subclass. If it weren't for that bug, we'd override
65- // _withVerbatimBridgedUnsafeBuffer directly in
66- // _ContiguousArrayStorage<Element>.
67- // rdar://problem/19341002
68- class _ContiguousArrayStorage1 : _ContiguousArrayStorageBase {
62+ // The class that implements the storage for a ContiguousArray<Element>
63+ @_versioned
64+ final class _ContiguousArrayStorage < Element> : _ContiguousArrayStorageBase {
65+
66+ deinit {
67+ _elementPointer. deinitialize ( count: countAndCapacity. count)
68+ _fixLifetime ( self )
69+ }
70+
6971#if _runtime(_ObjC)
7072 /// If the `Element` is bridged verbatim, invoke `body` on an
7173 /// `UnsafeBufferPointer` to the elements and return the result.
@@ -82,28 +84,7 @@ class _ContiguousArrayStorage1 : _ContiguousArrayStorageBase {
8284
8385 /// If `Element` is bridged verbatim, invoke `body` on an
8486 /// `UnsafeBufferPointer` to the elements.
85- internal func _withVerbatimBridgedUnsafeBufferImpl(
86- _ body: ( UnsafeBufferPointer < AnyObject > ) throws -> Void
87- ) rethrows {
88- _sanityCheckFailure (
89- " Must override _withVerbatimBridgedUnsafeBufferImpl in derived classes " )
90- }
91- #endif
92- }
93-
94- // The class that implements the storage for a ContiguousArray<Element>
95- @_versioned
96- final class _ContiguousArrayStorage < Element> : _ContiguousArrayStorage1 {
97-
98- deinit {
99- _elementPointer. deinitialize ( count: countAndCapacity. count)
100- _fixLifetime ( self )
101- }
102-
103- #if _runtime(_ObjC)
104- /// If `Element` is bridged verbatim, invoke `body` on an
105- /// `UnsafeBufferPointer` to the elements.
106- internal final override func _withVerbatimBridgedUnsafeBufferImpl(
87+ internal final func _withVerbatimBridgedUnsafeBufferImpl(
10788 _ body: ( UnsafeBufferPointer < AnyObject > ) throws -> Void
10889 ) rethrows {
10990 if _isBridgedVerbatimToObjectiveC ( Element . self) {
0 commit comments