This repository has been archived by the owner on Oct 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Subscript
mattt edited this page Mar 28, 2020
·
8 revisions
A subscript declaration.
public struct Subscript: Declaration, Hashable, Codable
Codable
, Hashable
, Declaration
Creates an instance initialized with the given syntax node.
public init(_ node: SubscriptDeclSyntax)
The generic parameters for the declaration.
let genericParameters: [GenericParameter]
For example,
the following subscript declaration
has a single generic parameter
whose name
is "T"
and type
is "Equatable"
:
subscript<T: Equatable>(value: T) {}
var description: String
The declaration keyword ("subscript"
).
let keyword: String
The declaration attributes.
let attributes: [Attribute]
The subscript getter and/or setter.
let accessors: [Variable.Accessor]
The declaration modifiers.
let modifiers: [Modifier]
The return type of the subscript.
let returnType: String
The subscript indices.
let indices: [Function.Parameter]
The generic parameter requirements for the declaration.
let genericRequirements: [GenericRequirement]
For example,
the following subscript declaration
has a single requirement
that its generic parameter identified as "T"
conforms to the type identified as "Hahable"
:
subscript<T>(value: T) where T: Hashable {}
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