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 Aug 2, 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>
  • The first generic parameter is named "T" and has no type constraint.

  • The second generic parameter is named "U" and a type constraint on "Equatable".

Inheritance

Codable, CustomStringConvertible, ExpressibleBySyntax, Hashable

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