-
Notifications
You must be signed in to change notification settings - Fork 29
Class
A class declaration.
public struct Class: Declaration, Hashable, Codable
Declaration
, Hashable
, Codable
, ExpressibleBySyntax
, CustomStringConvertible
Creates an instance initialized with the given syntax node.
public init(_ node: ClassDeclSyntax)
A dot-delimited (.
) path used to qualify the class name
within the module scope of the declaration,
or nil
if the class isn't nested
(that is, declared at the top-level scope of a module).
let context: String?
For example,
given the following declaration of a class C
,
the context
is "A.B"
:
class A { class B { class C {} }
The declaration attributes.
let attributes: [Attribute]
The declaration modifiers.
let modifiers: [Modifier]
The declaration keyword ("class"
).
let keyword: String
The class name.
let name: String
A list of inherited type names.
let inheritance: [String]
If the class is a subclass, the first element is the superclass. Any other elements are names of protocols.
For example,
given the following declarations,
the inheritance
of class C
is ["B", "P"]
:
protocol P {}
class A {}
class B: A {}
class C: B, P {}
The generic parameters for the declaration.
let genericParameters: [GenericParameter]
For example,
the following declaration of class C
has a single generic parameter
whose name
is "T"
and type
is "Equatable"
:
class C<T: Equatable> {}
The generic parameter requirements for the declaration.
let genericRequirements: [GenericRequirement]
For example,
the following declaration of class C
has a single requirement
that its generic parameter identified as "T"
conforms to the type identified as "Hahable"
:
class C<T> 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