Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Typealias

Mattt edited this page Aug 2, 2020 · 6 revisions

Typealias

A type alias declaration.

public struct Typealias:​ Declaration, Hashable, Codable

Inheritance

Codable, CustomStringConvertible, Declaration, ExpressibleBySyntax, Hashable

Initializers

init(_:​)

Creates an instance initialized with the given syntax node.

public init(_ node:​ TypealiasDeclSyntax)

Properties

attributes

The declaration attributes.

let attributes:[Attribute]

modifiers

The declaration modifiers.

let modifiers:[Modifier]

keyword

The declaration keyword ("typealias").

let keyword:​ String

name

The type alias name.

let name:​ String

initializedType

The initialized type, if any.

let initializedType:​ String?

genericParameters

The generic parameters for the declaration.

let genericParameters:[GenericParameter]

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>

genericRequirements

The generic parameter requirements for the declaration.

let genericRequirements:[GenericRequirement]

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
Clone this wiki locally