sun::ast::TypeAnnotation
struct · Source (opens in a new tab)
struct sun::ast::TypeAnnotationType annotation structure for parsed type info Supports: i32, f64, bool, void, ptr<T>, ref T, function, lambda Generic types: ClassName<T, U> for class instantiation Array types: array<T, N> or array<T, M, N> for fixed-size arrays Error union types: T, error (value or error).
Public Functions
- TypeAnnotation
- isAnonymousFrameLambda
- isArray
- isCallable
- isConstReference
- isErrorUnion
- isFunction
- isGeneric
- isLambda
- isRawPointer
- isReference
- isStaticPointer
- operator=
- operator==
- toString
TypeAnnotation
TypeAnnotation(const TypeAnnotation &other)
public · function · Source (opens in a new tab)
sun::ast::TypeAnnotation::TypeAnnotation(const TypeAnnotation &other)Creates a type annotation from a name or an existing annotation.
TypeAnnotation(TypeAnnotation &&)=default
public · function · Source (opens in a new tab)
sun::ast::TypeAnnotation::TypeAnnotation(TypeAnnotation &&)=defaultCreates a type annotation from a name or an existing annotation.
TypeAnnotation()=default
public · function · Source (opens in a new tab)
sun::ast::TypeAnnotation::TypeAnnotation()=defaultCreates a type annotation from a name or an existing annotation.
TypeAnnotation(std::string name)
public · function · Source (opens in a new tab)
sun::ast::TypeAnnotation::TypeAnnotation(std::string name)Creates a type annotation from a name or an existing annotation.
isAnonymousFrameLambda
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isAnonymousFrameLambda() constReports whether this is a <'_> lambda type whose frame has no name: written <'_> or with no lifetime at all.
Such a type cannot be returned, because its environment dies with the frame that made it.
isArray
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isArray() constReports whether this syntax node represents an array annotation.
isCallable
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isCallable() constReports whether this value can be invoked as a function.
isConstReference
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isConstReference() constReports whether this syntax node represents a reference without write access.
isErrorUnion
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isErrorUnion() constReports whether this syntax node represents a value-or-error type.
isFunction
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isFunction() constReports whether this syntax node represents a function definition.
isGeneric
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isGeneric() constReports whether this declaration still has unbound type parameters.
isLambda
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isLambda() constReports whether this syntax node represents a lambda expression.
isRawPointer
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isRawPointer() constReports whether this syntax node represents a raw-pointer annotation.
isReference
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isReference() constReports whether this syntax node represents a borrowed-reference annotation.
isStaticPointer
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::isStaticPointer() constReports whether this syntax node represents a static-pointer annotation.
operator=
operator=(TypeAnnotation &&)=default
public · function · Source (opens in a new tab)
TypeAnnotation & sun::ast::TypeAnnotation::operator=(TypeAnnotation &&)=defaultTransfers the stored state from another instance during move assignment.
Related: TypeAnnotation
operator=(const TypeAnnotation &other)
public · function · Source (opens in a new tab)
TypeAnnotation & sun::ast::TypeAnnotation::operator=(const TypeAnnotation &other)Replaces the stored state with a copy of another instance.
Related: TypeAnnotation
operator==
public · function · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::operator==(const TypeAnnotation &other) constCompare type structure and resolved names, ignoring source locations.
Related: TypeAnnotation
toString
public · function · Source (opens in a new tab)
std::string sun::ast::TypeAnnotation::toString() constReturns a readable representation for diagnostics and debugging.
Public Fields
- arrayDimensions
- baseName
- canError
- constRef
- declarationKey
- elementType
- lifetimeArguments
- lifetimeName
- paramTypes
- refEnv
- requiresUnsafe
- returnType
- span
- typeArguments
arrayDimensions
public · variable · Source (opens in a new tab)
std::vector<ArrayDimension> sun::ast::TypeAnnotation::arrayDimensionsNo documentation comment.
Related: ArrayDimension
baseName
public · variable · Source (opens in a new tab)
std::string sun::ast::TypeAnnotation::baseNameNo documentation comment.
canError
public · variable · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::canError = falseNo documentation comment.
constRef
public · variable · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::constRef = falseNo documentation comment.
declarationKey
public · variable · Source (opens in a new tab)
std::optional<sun::semantic_analysis::PortableDeclarationKey> sun::ast::TypeAnnotation::declarationKeyNo documentation comment.
Related: sun::semantic_analysis::PortableDeclarationKey
elementType
public · variable · Source (opens in a new tab)
std::unique_ptr<TypeAnnotation> sun::ast::TypeAnnotation::elementTypeNo documentation comment.
Related: TypeAnnotation
lifetimeArguments
public · variable · Source (opens in a new tab)
std::vector<std::string> sun::ast::TypeAnnotation::lifetimeArgumentsNo documentation comment.
lifetimeName
public · variable · Source (opens in a new tab)
std::string sun::ast::TypeAnnotation::lifetimeNameNo documentation comment.
paramTypes
public · variable · Source (opens in a new tab)
std::vector<std::unique_ptr<TypeAnnotation> > sun::ast::TypeAnnotation::paramTypesNo documentation comment.
Related: TypeAnnotation
refEnv
public · variable · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::refEnv = falseNo documentation comment.
requiresUnsafe
public · variable · Source (opens in a new tab)
bool sun::ast::TypeAnnotation::requiresUnsafe = falseNo documentation comment.
returnType
public · variable · Source (opens in a new tab)
std::unique_ptr<TypeAnnotation> sun::ast::TypeAnnotation::returnTypeNo documentation comment.
Related: TypeAnnotation
span
public · variable · Source (opens in a new tab)
sun::support::Position sun::ast::TypeAnnotation::span {}No documentation comment.
Related: sun::support::Position
typeArguments
public · variable · Source (opens in a new tab)
std::vector<std::unique_ptr<TypeAnnotation> > sun::ast::TypeAnnotation::typeArgumentsNo documentation comment.
Related: TypeAnnotation