SwiftSemantics Documentation Beta

Structure Typealias

public struct Typealias: Declaration, Hashable, Codable

A type alias declaration.

%3 Typealias Typealias Codable Codable Typealias->Codable Hashable Hashable Typealias->Hashable CustomStringConvertible CustomStringConvertible Typealias->CustomStringConvertible Declaration Declaration Typealias->Declaration ExpressibleBySyntax ExpressibleBySyntax Typealias->ExpressibleBySyntax

Conforms To

Declaration

A Swift declaration.

ExpressibleBySyntax

A type that can be initialized with a Swift syntax node.

Codable
CustomStringConvertible
Hashable

Initializers

init(_:​)

public init(_ node: TypealiasDeclSyntax)

Creates an instance initialized with the given syntax node.

Properties

attributes

let attributes: [Attribute]

The declaration attributes.

modifiers

let modifiers: [Modifier]

The declaration modifiers.

keyword

let keyword: String

The declaration keyword ("typealias").

name

let name: String

The type alias name.

initialized​Type

let initializedType: String?

The initialized type, if any.

generic​Parameters

let genericParameters: [GenericParameter]

The generic parameters for the declaration.

For example, the following typealias declaration has a single generic parameter whose name is "T" and type is "Comparable":

typealias SortableArray<T: Comparable> = Array<T>

generic​Requirements

let genericRequirements: [GenericRequirement]

The generic parameter requirements for the declaration.

For example, the following typealias declaration has a single requirement that its generic parameter identified as "T" conforms to the type identified as "Numeric":

typealias ArrayOfNumbers<T> = Array<T> where T: Numeric

description

var description: String