v1/src/compiler/analyzed_class library

Classes

AnalyzedClass
A wrapper around ClassElement which exposes the functionality needed for the view compiler to find types for expressions.

Functions

boolType(AnalyzedClass analyzedClass) → DartType
Returns an bool type using the analyzedClass's context.
canBeNull(AST expression) → bool
Returns true if expression could be null.
getExpressionType(AST expression, AnalyzedClass analyzedClass) → DartType
Returns the expression type evaluated within context of analyzedClass.
getIterableElementType(DartType dartType, LibraryElement lib) → DartType?
Returns the element type of dartType, assuming it implements Iterable.
intType(AnalyzedClass analyzedClass) → DartType
Returns an int type using the analyzedClass's context.
isBool(AST expression, AnalyzedClass analyzedClass) → bool
Returns whether the type expression is bool.
isDouble(AST expression, AnalyzedClass analyzedClass) → bool
Returns whether the type expression is double.
isImmutable(AST expression, AnalyzedClass? analyzedClass) → bool
Returns true if expression is immutable.
isInt(AST expression, AnalyzedClass analyzedClass) → bool
Returns whether the type expression is int.
isNumber(AST expression, AnalyzedClass analyzedClass) → bool
Returns whether the type expression is num.
isStaticGetterOrMethod(String name, AnalyzedClass analyzedClass) → bool
isStaticSetter(String name, AnalyzedClass analyzedClass) → bool
isString(AST expression, AnalyzedClass analyzedClass) → bool
Returns whether the type expression is String.
rewriteTearOff(ASTWithSource original, AnalyzedClass analyzedClass) → ASTWithSource
Rewrites an event tear-off as a method call.
typeToCode(DartType type) → String