Skip to content

GenericArgument

tevelee edited this page Jul 25, 2026 · 2 revisions

GenericArgument

One word in a generic metadata argument layout.

public enum GenericArgument 

Swift 6 generic layouts can contain packs and value arguments in addition to ordinary type metadata and witness tables. The cases preserve that ABI distinction rather than interpreting every word as an Any.Type.

Enumeration Cases

packLength

The runtime length of a type-parameter pack.

case packLength(Int)

metadata

Metadata for an ordinary type parameter.

case metadata(Any.Type)

metadataPack

A pointer to a runtime metadata pack.

case metadataPack(UnsafeRawPointer)

witnessTable

A witness table for an ordinary protocol requirement.

case witnessTable(WitnessTable)

witnessTablePack

A pointer to a runtime witness-table pack.

case witnessTablePack(UnsafeRawPointer)

value

A raw value argument. Its representation is described by the generic context's GenericValueDescriptor records.

case value(UInt)

Properties

metadataPackValue

A typed view of this metadata-pack argument, if it is one.

public var metadataPackValue: MetadataPack? 

witnessTablePackValue

A typed view of this witness-table-pack argument, if it is one.

public var witnessTablePackValue: WitnessTablePack? 
Types
Protocols
Global Typealiases
Global Variables
Global Functions

Clone this wiki locally