TypeSyntaxProtocol
Protocol to which all TypeSyntax
nodes conform.
protocol TypeSyntaxProtocol : SyntaxProtocol
Browse conforming typesExtension point to add common methods to all TypeSyntax
nodes.
Protocol to which all TypeSyntax
nodes conform.
protocol TypeSyntaxProtocol : SyntaxProtocol
Extension point to add common methods to all TypeSyntax
nodes.
import SwiftSyntax
A library for working with Swift code.
struct TypeSyntax
protocol SyntaxProtocol : CustomDebugStringConvertible, CustomReflectable, CustomStringConvertible, Sendable, TextOutputStreamable
Provide common functionality for specialized syntax nodes. Extend this protocol to provide common functionality for all syntax nodes.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomReflectable
A type that explicitly supplies its own mirror.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Sendable
protocol TextOutputStreamable
A source of text-streaming operations.
struct MissingTypeSyntax
In case the source code is missing a type, this node stands in place of the missing type.
struct ArrayTypeSyntax
struct AttributedTypeSyntax
struct ClassRestrictionTypeSyntax
struct CompositionTypeSyntax
struct DictionaryTypeSyntax
struct FunctionTypeSyntax
struct IdentifierTypeSyntax
struct ImplicitlyUnwrappedOptionalTypeSyntax
struct MemberTypeSyntax
struct MetatypeTypeSyntax
struct NamedOpaqueReturnTypeSyntax
struct OptionalTypeSyntax
struct PackElementTypeSyntax
struct PackExpansionTypeSyntax
struct SomeOrAnyTypeSyntax
struct SuppressedTypeSyntax
struct TupleTypeSyntax
func `as`<S>(_ syntaxType: S.Type) -> S? where S : TypeSyntaxProtocol
Attempts to cast the current syntax node to a given specialized syntax type.
func cast<S>(_ syntaxType: S.Type) -> S where S : TypeSyntaxProtocol
Force-casts the current syntax node to a given specialized syntax type.
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : TypeSyntaxProtocol
Checks if the current syntax node can be cast to a given specialized syntax type.
func `as`(_ syntaxType: TypeSyntax.Type) -> TypeSyntax?
Attempts to upcast the current syntax node to its base node type (TypeSyntax
).
func `as`<S>(_ syntaxType: S.Type) -> S? where S : SyntaxProtocol
Attempts to cast the current syntax node to a given node type from the a base node protocol hierarchy other than TypeSyntaxProtocol
.
func cast(_ syntaxType: TypeSyntax.Type) -> TypeSyntax
Force-upcast the current syntax node to its base node type (TypeSyntax
).
func cast<S>(_ syntaxType: S.Type) -> S where S : SyntaxProtocol
Force-casts the current syntax node to a given node type from a base node protocol hierarchy other than TypeSyntaxProtocol
.
func `is`(_ syntaxType: TypeSyntax.Type) -> Bool
Checks if the current syntax node can be upcast to its base node type (TypeSyntax
).
func `is`<S>(_ syntaxType: S.Type) -> Bool where S : SyntaxProtocol
Checks if the current syntax node can be cast to a given node type from a base node protocol hierarchy other than TypeSyntaxProtocol
.
protocol _LeafTypeSyntaxNodeProtocol : TypeSyntaxProtocol
Protocol that syntax nodes conform to if they don’t have any semantic subtypes. These are syntax nodes that are not considered base nodes for other syntax types.