Skip to content

ConformanceDescriptor_Flags

Azoy edited this page May 6, 2021 · 2 revisions

ConformanceDescriptor.Flags

The flags that describe a conformance to a protocol for a type.

public struct Flags 

Properties

bits

Flags as represented in bits.

public let bits: UInt32

hasGenericWitnessTable

Whether or not the conformance descriptor's witness table pattern is used as a pattern or if it's served as the real witness table. This is most likely true when the conformance is about a generic type and false when the conformance is about a non generic type. Please make sure to consult this flag beforehand though to make sure.

public var hasGenericWitnessTable: Bool 

hasResilientWitnesses

Whether or not this conformance has resilient witnesses.

public var hasResilientWitnesses: Bool 

isRetroactive

Whether or not this conformance is retroactive. A conformance is considered retroactive when it happens in a module that is not the module the protocol was defined in and not the module the type conforming was defined in.

public var isRetroactive: Bool 

isSynthesizedNonUnique

Whether or not this conformance was synthesized non-uniquely. This happens when an imported C structure or such defines a Swift conformance.

public var isSynthesizedNonUnique: Bool 

numConditionalRequirements

The number of conditional requirements this conformance requires. This occurs with conditional conformance situations where a type only conforms if one/a few/all of its generic parameters conform to some protocol. Another example is a type conforming to some protocol if it has some same type requirement.

public var numConditionalRequirements: Int 

typeReferenceKind

The type reference kind to the type that is conforming to some protocol in this conformance.

public var typeReferenceKind: TypeReferenceKind 
Types
Protocols
Global Variables
Global Functions
Clone this wiki locally