SwiftSemantics Documentation Beta

Structure Generic​Parameter

public struct GenericParameter: Hashable, Codable

A generic parameter.

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>
%3 GenericParameter GenericParameter ExpressibleBySyntax ExpressibleBySyntax GenericParameter->ExpressibleBySyntax Codable Codable GenericParameter->Codable Hashable Hashable GenericParameter->Hashable CustomStringConvertible CustomStringConvertible GenericParameter->CustomStringConvertible

Conforms To

ExpressibleBySyntax

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

Codable
CustomStringConvertible
Hashable

Initializers

init(_:​)

public init(_ node: GenericParameterSyntax)

Creates an instance initialized with the given syntax node.

Properties

attributes

let attributes: [Attribute]

The generic parameter attributes.

name

let name: String

The generic parameter name.

type

let type: String?

The generic parameter type, if any.

description

var description: String