third_party/closure-compiler/src/src/com/google/javascript/rhino/jstype/NamedType.java
/** Warns about this type being unresolved iff it's not a forward-declared type name */
Warns about this type being unresolved iff it's not a forward-declared type name
Warns about this type being unresolved iff it ' s not a forward - declared type name
private void handleUnresolvedType(
      ErrorReporter reporter, boolean ignoreForwardReferencedTypes) {
    boolean isForwardDeclared =
        ignoreForwardReferencedTypes && registry.isForwardDeclaredType(reference);
    if (!isForwardDeclared) {
      String msg = "Bad type annotation. Unknown type " + reference;
      String root =
          reference.contains(".") ? reference.substring(0, reference.indexOf(".")) : reference;
      if (localVariableShadowsGlobalNamespace(root)) {
        msg += "\nIt's possible that a local variable called '" + root
            + "' is shadowing the intended global namespace.";
      }
      warning(reporter, msg);
    } else {
      setReferencedType(new NoResolvedType(registry, getReferenceName(), getTemplateTypes()));
      if (validator != null) {
        validator.apply(getReferencedType());
      }
    }
    setResolvedTypeInternal(getReferencedType());
  }
private void handleUnresolvedType ( ErrorReporter reporter , boolean ignoreForwardReferencedTypes ) { boolean isForwardDeclared = ignoreForwardReferencedTypes && registry . isForwardDeclaredType ( reference ) ; if ( ! isForwardDeclared ) { String msg = "Bad type annotation. Unknown type " + reference ; String root = reference . contains ( "." ) ? reference . substring ( 0 , reference . indexOf ( "." ) ) : reference ; if ( localVariableShadowsGlobalNamespace ( root ) ) { msg += "\nIt's possible that a local variable called '" + root + "' is shadowing the intended global namespace." ; } warning ( reporter , msg ) ; } else { setReferencedType ( new NoResolvedType ( registry , getReferenceName ( ) , getTemplateTypes ( ) ) ) ; if ( validator != null ) { validator . apply ( getReferencedType ( ) ) ; } } setResolvedTypeInternal ( getReferencedType ( ) ) ; }
Warns about this type being unresolved iff it's not a forward-declared type name
Warns about this type being unresolved iff it ' s not a forward - declared type name
// Look for a local variable that shadows a global namespace to give a clearer message.