public class TypedVar extends AbstractVar<TypedScope,TypedVar> implements StaticTypedSlot<JSType>, StaticTypedRef<JSType>
AbstractVar subclass for use with TypedScope.
Note that this class inherits its equals(java.lang.Object) and hashCode()
implementations from ScopedName, which does not include any type
information. This is necessary because Var-keyed maps are used
across multiple top scopes, but it comes with the caveat that if TypedVar instances are stored in a set, the type information is at risk
of disappearing if an untyped (or differently typed) var is added for the
same symbol.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getInputName() |
JSType |
getType()
Gets this variable's type.
|
int |
hashCode() |
boolean |
isTypeInferred()
Returns whether this variable's type is inferred.
|
java.lang.String |
toString() |
declarationType, getDeclaration, getInitialValue, getJSDocInfo, getName, getNameNode, getNode, getParentNode, getScope, getScopeRoot, getSourceFile, getSymbol, isArguments, isBleedingFunction, isDefaultParam, isDefine, isGlobal, isInferredConst, isLocal, isThisclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDeclaration, getScopegetJSDocInfo, getNamegetSymbolgetNode, getSourceFilepublic JSType getType()
#isTypeInferred().getType in interface StaticTypedSlot<JSType>null if no type is declared for it.public boolean isTypeInferred()
getType().isTypeInferred in interface StaticTypedSlot<JSType>public java.lang.String getInputName()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2009-2018 Google. All Rights Reserved.