mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Don't use AnyObject.self as ClassMetadata
Works around <rdar://problem/18777102>, and is smaller code to boot. Swift SVN r22958
This commit is contained in:
@@ -161,13 +161,7 @@ internal struct _HeapBuffer<Value, Element> : Equatable {
|
||||
}
|
||||
|
||||
init<T: AnyObject>(_ storage: T?) {
|
||||
_sanityCheck(
|
||||
_usesNativeSwiftReferenceCounting(T.self),
|
||||
"HeapBuffer manages only native objects"
|
||||
)
|
||||
self._storage = storage.map {
|
||||
Builtin.castToNativeObject($0)
|
||||
}
|
||||
self = storage.map { _HeapBuffer($0) } ?? _HeapBuffer()
|
||||
}
|
||||
|
||||
init(nativeStorage: Builtin.NativeObject?) {
|
||||
|
||||
Reference in New Issue
Block a user