-
Notifications
You must be signed in to change notification settings - Fork 31
GenericRequirement
A generic requirement.
public struct GenericRequirement: Hashable, CodableA generic type or function declaration may specifying one or more requirements
in a generic where clause before the opening curly brace ({) its body.
Each generic requirement establishes a relation between two type identifiers.
For example, the following declaration specifies two generic requirements:
func difference<C1: Collection, C2: Collection>(between lhs: C1, and rhs: C2) -> [C1.Element]
where C1.Element: Equatable, C1.Element == C2.Element-
The first generic requirement establishes a
conformancerelation between the generic types identified by"C1.Element"and"Equatable" -
The second generic requirement establsihes a
sameTyperelation between the generic types identified by"C1.Element"and"C2.Element"
Codable, CustomStringConvertible, Hashable
The relation between the two identified types.
let relation: RelationThe identifier for the left-hand side type.
let leftTypeIdentifier: StringThe identifier for the right-hand side type.
let rightTypeIdentifier: Stringvar description: StringCreates and returns generic requirements initialized from a generic requirement list syntax node.
public static func genericRequirements(from node: GenericRequirementListSyntax?) -> [GenericRequirement]- from: - from: The generic requirement list syntax node, or
nil.
An array of generic requirements, or nil if the node is nil.
Generated at 2020-08-02T12:14:07+0000 using swift-doc 1.0.0-beta.3.
Types
- AssociatedType
- Attribute
- Attribute.Argument
- Class
- ConditionalCompilationBlock
- ConditionalCompilationBlock.Branch
- DeclarationCollector
- Deinitializer
- Enumeration
- Enumeration.Case
- Extension
- Function
- Function.Parameter
- Function.Signature
- GenericParameter
- GenericRequirement
- GenericRequirement.Relation
- Import
- Initializer
- Modifier
- Operator
- Operator.Kind
- PrecedenceGroup
- PrecedenceGroup.Associativity
- PrecedenceGroup.Relation
- Protocol
- Structure
- Subscript
- Typealias
- Variable
- Variable.Accessor
- Variable.Accessor.Kind