[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:
Dave Abrahams
2014-10-27 04:45:46 +00:00
parent f07b42ee9a
commit 6daf5cf8dc

View File

@@ -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?) {