/** Resolve the referenced type within the enclosing scope. */ @Override JSType resolveInternal(ErrorReporter t, StaticTypedScope<JSType> enclosing) { // TODO(user): Investigate whether it is really necessary to keep two // different mechanisms for resolving named types, and if so, which order // makes more sense. Now, resolution via registry is first in order to // avoid triggering the warnings built into the resolution via properties. boolean resolved = resolveViaRegistry(t); if (detectInheritanceCycle()) { handleTypeCycle(t); } if (resolved) { super.resolveInternal(t, enclosing); finishPropertyContinuations(); return getReferencedType(); } resolveViaProperties(t, enclosing); if (detectInheritanceCycle()) { handleTypeCycle(t); } super.resolveInternal(t, enclosing); if (isResolved()) { finishPropertyContinuations(); } return getReferencedType(); }
@Override StringBuilder appendTo(StringBuilder sb, boolean forAnnotations) { super.appendTo(sb, forAnnotations); if (!this.templateTypes.isEmpty()) { sb.append("<"); int lastIndex = this.templateTypes.size() - 1; for (int i = 0; i < lastIndex; i++) { this.templateTypes.get(i).appendTo(sb, forAnnotations); sb.append(","); } this.templateTypes.get(lastIndex).appendTo(sb, forAnnotations); sb.append(">"); } return sb; }