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

GenericRequirement_Relation

mattt edited this page Mar 28, 2020 · 6 revisions

GenericRequirement.Relation

A relation between the two types identified in the generic requirement.

public enum Relation

For example, the declaration struct S<T: Equatable> has a single generic requirement that the type identified by "T" conforms to the type identified by "Equatable".

Inheritance

Codable, Hashable, String

Properties

leftTypeIdentifier

The identifier for the left-hand side type.

let leftTypeIdentifier: String

relation

The relation between the two identified types.

let relation: Relation

description

var description: String

rightTypeIdentifier

The identifier for the right-hand side type.

let rightTypeIdentifier: String

Methods

genericRequirements(from:)

Creates and returns generic requirements initialized from a generic requirement list syntax node.

public static func genericRequirements(from node: GenericRequirementListSyntax?) -> [GenericRequirement]

Parameters

  • from: The generic requirement list syntax node, or nil.

Returns

An array of generic requirements, or nil if the node is nil.