Skip to content

TypeContextDescriptor

tevelee edited this page Jul 25, 2026 · 2 revisions

TypeContextDescriptor

A type context descriptor is a context descriptor who defines some new type. This includes structs, classes, and enums. Protocols also define a new type, but aren't considered type context descriptors.

public protocol TypeContextDescriptor: ContextDescriptor 

ABI Stability: Stable since the following

| macOS | iOS/tvOS | watchOS | Linux | Windows |
|-------|----------|---------|-------|---------|
| 10.14 | 12.2     | 5.2     | NA    | NA      |

Inheritance

ContextDescriptor

Default Implementations

typeFlags

The flags that describe this type context descriptor.

public var typeFlags: TypeContextDescriptorFlags 

name

The name of this type.

public var name: String 

accessor

The metadata access function.

public var accessor: MetadataAccessFunction 

isReflectable

Whether or not this type has a field descriptor.

public var isReflectable: Bool 

fields

The field descriptor that describes the stored representation of this type.

public var fields: FieldDescriptor 

typeGenericContext

The generic context that is unique to type context descriptors.

public var typeGenericContext: TypeGenericContext 

typeImportInfo

Importer-provided identity data, or nil when this is not an imported type or its record uses an ABI component Echo does not understand.

public var typeImportInfo: TypeImportInfo? 

abiName

The name used by Swift's ABI for this type. Imported types may override the user-facing name with a stable ABI name.

public var abiName: String 

Requirements

typeFlags

The flags that describe this type context descriptor.

var typeFlags: TypeContextDescriptorFlags 

name

The name of this type.

var name: String 

accessor

The metadata access function.

var accessor: MetadataAccessFunction 

fields

The field descriptor that describes the stored representation of this type.

var fields: FieldDescriptor 

foreignMetadataInitialization

If this type has foreign metadata initialization, return it.

var foreignMetadataInitialization: ForeignMetadataInitialization? 

singletonMetadataInitialization

If this type has singleton metadata initialization, return it.

var singletonMetadataInitialization: SingletonMetadataInitialization? 
Types
Protocols
Global Typealiases
Global Variables
Global Functions

Clone this wiki locally