SubscriptDecl
public struct SubscriptDecl : BundleDecl, CapturingDecl, GenericDecl
A subscript declaration.
-
Declaration
Swift
public static let constructDescription: String -
Declaration
Swift
public typealias Variant = SubscriptImpl -
Undocumented
See moreDeclaration
Swift
public enum Introducer : Codable, Sendable -
Declaration
Swift
public static let isCallable: Bool -
Declaration
Swift
public let site: SourceRange -
The introducer of the declaration.
Declaration
Swift
public let introducer: SourceRepresentable<Introducer> -
The attributes of the declaration.
Declaration
Swift
public let attributes: [SourceRepresentable<Attribute>] -
The access modifier of the declaration, if any.
Declaration
Swift
public let accessModifier: SourceRepresentable<AccessModifier> -
The member modifier of the declaration.
Declaration
Swift
public let memberModifier: SourceRepresentable<MemberModifier>? -
The identifier of the subscript, if any.
Declaration
Swift
public let identifier: SourceRepresentable<Identifier>? -
The generic clause of the declaration, if any.
Declaration
Swift
public let genericClause: SourceRepresentable<GenericClause>? -
The explicit capture declarations of the subscript.
Declaration
Swift
public let explicitCaptures: [BindingDecl.ID] -
The parameters of the subscript, empty for a property declaration.
These declarations must have a type annotation.
Declaration
Swift
public let parameters: [ParameterDecl.ID] -
The output type annotation of the subscript.
Declaration
Swift
public let output: AnyExprID -
The implementations of the subscript.
Declaration
Swift
public let impls: [SubscriptImpl.ID] -
init(introducer:attributes: accessModifier: memberModifier: identifier: genericClause: explicitCaptures: parameters: output: impls: site: ) Creates an instance with the given properties.
Declaration
Swift
public init( introducer: SourceRepresentable<Introducer>, attributes: [SourceRepresentable<Attribute>], accessModifier: SourceRepresentable<AccessModifier>, memberModifier: SourceRepresentable<MemberModifier>?, identifier: SourceRepresentable<Identifier>?, genericClause: SourceRepresentable<GenericClause>?, explicitCaptures: [BindingDecl.ID], parameters: [ParameterDecl.ID], output: AnyExprID, impls: [SubscriptImpl.ID], site: SourceRange ) -
Returns whether the declaration introduces a property.
Declaration
Swift
public var isProperty: Bool { get } -
Returns whether the declaration denotes a static subscript.
Declaration
Swift
public var isStatic: Bool { get } -
The part of the declaration that may have implicit captures.
Declaration
Swift
public var sourcesOfImplicitCaptures: [AnyNodeID] { get } -
Declaration
Swift
public func validateForm(in ast: AST, reportingDiagnosticsTo log: inout DiagnosticSet)
View on GitHub