DartType class

The type associated with elements in the element model.

Clients may not extend, implement or mix-in this class.

Implemented by

Constructors

DartType()

Properties

displayName String
Return the name of this type as it should appear when presented to users in contexts such as error messages.
read-only
element Element
Return the element representing the declaration of this type, or null if the type has not, or cannot, be associated with an element. The former case will occur if the element model is not yet complete; the latter case will occur if this object represents an undefined type.
read-only
isBottom bool
Return true if this type represents the bottom type.
read-only
isDartAsyncFuture bool
Return true if this type represents the type 'Future' defined in the dart:async library.
read-only
isDartCoreFunction bool
Return true if this type represents the type 'Function' defined in the dart:core library.
read-only
isDynamic bool
Return true if this type represents the type 'dynamic'.
read-only
isObject bool
Return true if this type represents the type 'Object'.
read-only
isUndefined bool
Return true if this type represents a typename that couldn't be resolved.
read-only
isVoid bool
Return true if this type represents the type 'void'.
read-only
name String
Return the name of this type, or null if the type does not have a name, such as when the type represents the type of an unnamed function.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

flattenFutures(TypeSystem typeSystem) DartType
Implements the function "flatten" defined in the spec, where T is this type: [...]
isAssignableTo(DartType type) bool
Return true if this type is assignable to the given type. A type T may be assigned to a type S, written TS, iff either T <: S or S <: T.
isMoreSpecificThan(DartType type) bool
Return true if this type is more specific than the given type.
isSubtypeOf(DartType type) bool
Return true if this type is a subtype of the given type.
isSupertypeOf(DartType type) bool
Return true if this type is a supertype of the given type. A type S is a supertype of T, written S :> T, iff T is a subtype of S.
resolveToBound(DartType objectType) DartType
If this type is a TypeParameterType, returns its bound if it has one, or objectType otherwise. [...]
substitute2(List<DartType> argumentTypes, List<DartType> parameterTypes) DartType
Return the type resulting from substituting the given argumentTypes for the given parameterTypes in this type. The specification defines this operation in section 2: [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

EMPTY_LIST → const List<DartType>
An empty list of types.
const <DartType> []