nominalType.swift
var nominalTypeDescriptor: NominalTypeDescriptor? {
let pointer = UnsafePointer(self.pointer)
let base = pointer.advanced(by: nominalTypeDescriptorOffsetLocation)
if base.pointee == 0 {
// swift class created dynamically in objc-runtime didn't have valid nominalTypeDescriptor
return nil
}
#if swift(>=4.1)
return NominalTypeDescriptor(pointer: relativePointer(base: base, offset: base.pointee - base.hashValue))
#else
return NominalTypeDescriptor(pointer: relativePointer(base: base, offset: base.pointee))
#endif
}