ASTType<V> class

An AST Type.

Implemented types
Mixed-in types
Implementers
Available extensions

Constructors

ASTType(String name, {List<ASTType>? generics, ASTType? superType, List<ASTAnnotation>? annotations, bool nullable = false})

Properties

annotations → List<ASTAnnotation>?
final
children → Iterable<ASTNode>
The children nodes of this node.
no setteroverride
descendantChildren → List<ASTNode>
Return the children and it's descendant children (unmodifiable).
no setterinherited
generics → List<ASTType>?
final
hasGenerics → bool
Returns true if this type has generics.
no setter
hashCode → int
The hash code for this object.
no setteroverride
hasSuperType → bool
Returns true if this type has a super type.
no setter
isNullable → bool
Whether this type is nullable (alias for nullable).
no setter
name → String
final
nullable ↔ bool
Whether this type is nullable (the Dart ? suffix, e.g. String?).
getter/setter pair
parentNode → ASTNode?
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
superType → ASTType?
final

Methods

acceptsAssignment(ASTType type) → bool
Whether a value of type can be assigned to a slot of this type, accounting for nullability:
acceptsType(ASTType type) → bool
Will return true if type can be cast to this type. Note: This is similar to Java isInstance and isAssignableFrom.
asNullable([bool nullable = true]) → ASTType<V>
Returns a version of this type with the given nullable flag.
associateToType(ASTTypedNode node) → void
override
cacheDescendantChildren() → void
Mark that this node can cache its descendantChildren.
inherited
callCasted<R>(R call<T>()) → R
canCastToType(ASTType type) → bool
Return true if this can be cast to type;
cloneType() → ASTType
Returns a fresh, non-interned copy of this concrete type (with nullable reset to false). Subclasses override to preserve their concrete class so that structural dispatch (is ASTTypeArray, etc.) and typed value conversion keep working on nullable variants.
commonType(ASTType? other) → ASTType?
equalsStrict(ASTType other) → bool

Available on ASTType, provided by the ASTTypeExtension extension

getClass() → ASTClass<V>
getNodeIdentifier(String name, {ASTNode? requester}) → ASTNode?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveNode(ASTNode? parentNode) → void
override
resolveRuntimeType(VMContext context, ASTNode? node) → FutureOr<ASTType>
override
resolveType(VMContext? context) → FutureOr<ASTType>
override
setClass(ASTClass<V> clazz) → void
toASTValue(Object? value) → ASTValue<V>?
toDefaultValue(VMContext context) → FutureOr<ASTValue<V>?>
toString() → String
A string representation of this object.
override
toValue(VMContext context, Object? v) → FutureOr<ASTValue<V>?>
withoutNullability() → ASTType<V>
Returns the non-nullable form of this type.

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

from<T>(dynamic o, [VMContext? context]) → ASTType<T>
fromAsync(dynamic o) → FutureOr<ASTType>
fromNativeValue(dynamic o) → ASTType
fromType(Type type) → ASTType?