> On Dec 30, 2015, at 10:05 AM, Philippe Hausler <phaus...@apple.com> wrote:
> 
> That is the asset in the compiler that is being hit when the code 
> unsafeBitCasts to a c function.
> 
> typealias TypeMetadataAccessor = @convention(c) () -> AnyClass?
> let accessor = unsafeBitCast(symbol, TypeMetadataAccessor.self) // <— this 
> causes the compiler to assert there.

Under the ObjC runtime model, C and ObjC APIs represent class metatypes as 
pointers to their ObjC class representation, but that distinction doesn't 
matter in non-ObjC interop. This is easy to fix, but I'll reiterate that type 
metadata accessors are something you almost certainly have no business directly 
interacting with. What are you trying to do?

-Joe
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to