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

GenericParameter

mattt edited this page Jan 26, 2020 · 8 revisions

GenericParameter

A generic parameter.

public struct GenericParameter: Hashable, Codable

A generic type or function declaration includes a generic parameter clause, consisting of one or more generic parameters enclosed by angle brackets (<>). Each generic parameter has a name, and may also specify a type constraint. For example, the following structure declaration has two generic parameters:

struct S<T, U: Equatable>

Inheritance

Hashable, Codable, ExpressibleBySyntax, CustomStringConvertible

Initializers

init(_:)

Creates an instance initialized with the given syntax node.

public init(_ node: GenericParameterSyntax)

Properties

attributes

The generic parameter attributes.

let attributes: [Attribute]

name

The generic parameter name.

let name: String

type

The generic parameter type, if any.

let type: String?

description

var description: String