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
Extension
Mattt edited this page Aug 2, 2020
·
8 revisions
An extension declaration.
public struct Extension: Declaration, Hashable, Codable
Codable
, CustomStringConvertible
, Declaration
, ExpressibleBySyntax
, Hashable
Creates an instance initialized with the given syntax node.
public init(_ node: ExtensionDeclSyntax)
The declaration attributes.
let attributes: [Attribute]
The declaration modifiers.
let modifiers: [Modifier]
The declaration keyword ("extension"
).
let keyword: String
The name of the type extended by the extension.
let extendedType: String
A list of protocol names inherited by the extended type.
let inheritance: [String]
For example,
the following extension on structure S
has an inheritance
of ["P", "Q"]
:
struct S {}
protocol P {}
protocol Q {}
extension S: P, Q {}
The generic parameter requirements for the declaration.
let genericRequirements: [GenericRequirement]
For example,
the following conditional extension on structure S
has a single requirement
that its generic parameter identified as "T"
conforms to the type identified as "Hahable"
:
struct S<T> {}
extension S where T: Hashable {}
var description: String
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