@Override public boolean isSubtype(JSType that) { return isSubtype(that, ImplCache.create(), SubtypingMode.NORMAL); }
/** * Emits a type that is not resolved by closure. Depending on compilation options (whether we * are assuming forward declarations or not) we either emit the defaultEmit string passed, or * the literal string that was in the original code. Special care is taken for templatized * types. */ private void emitNoResolvedTypeOrDefault(NoType type, String defaultEmit) { if (!opts.partialInput || !type.isNoResolvedType()) { emit(defaultEmit); return; } // When processing partial inputs, this case handles implicitly forward declared types // for which we just emit the literal type written along with any type parameters. NoResolvedType nType = (NoResolvedType) type; // TODO(rado): Find a case where this happens for extends/implements and add // a test for it. if (nType.getReferenceName() == null) { emit(defaultEmit); return; } emitNoResolvedTypeAsumingForwardDeclare(type); }
private void handleUnresolvedType( ErrorReporter reporter, boolean ignoreForwardReferencedTypes) { boolean isForwardDeclared = ignoreForwardReferencedTypes && registry.isForwardDeclaredType(reference); if (!isForwardDeclared) { String msg = "Bad type annotation. Unknown type " + reference; warning(reporter, msg); } else { setReferencedType(new NoResolvedType(registry, getReferenceName(), getTemplateTypes())); if (validator != null) { validator.apply(getReferencedType()); } } setResolvedTypeInternal(getReferencedType()); }
ttypes = ((TemplatizedType) returnType).getTemplateTypes(); } else if (returnType.isNoResolvedType()) { ttypes = ((NoResolvedType) returnType).getTemplateTypes();
registerNativeType(JSTypeNative.NO_OBJECT_TYPE, NO_OBJECT_TYPE); NoObjectType NO_RESOLVED_TYPE = new NoResolvedType(this); registerNativeType(JSTypeNative.NO_RESOLVED_TYPE, NO_RESOLVED_TYPE);
registerNativeType(JSTypeNative.NO_OBJECT_TYPE, noObjectType); NoResolvedType noResolvedType = new NoResolvedType(this); registerNativeType(JSTypeNative.NO_RESOLVED_TYPE, noResolvedType);
@Override public boolean isSubtype(JSType that) { return isSubtype(that, ImplCache.create()); }