Avatar
The kind field is a pointer-sized integer that describes the kind of type the metadata describes. This field is at offset 0 from the metadata pointer.
12:14 PM
なので先頭っぽいですけどねぇ、
12:15 PM
struct Struct { } enum Enum { } protocol Protocol { } func kind(_ type: Any.Type) ->  Int { return unsafeBitCast(type, to: UnsafeMutablePointer<Int>.self).pointee } print(kind(Struct.self)) // 1 print(kind(Enum.self)) // 2 print(kind(Protocol.self)) // 12 (edited)