boolean isFull() { return numUnfilledTemplateKeys() == 0; }
/** * Returns a new TemplateTypeMap, where all unfilled values have been filled * with UNKNOWN_TYPE. */ private TemplateTypeMap addUnknownValues() { int numUnfilledTemplateKeys = numUnfilledTemplateKeys(); if (numUnfilledTemplateKeys == 0) { return this; } ImmutableList.Builder<JSType> builder = ImmutableList.builder(); for (int i = 0; i < numUnfilledTemplateKeys; i++) { builder.add(registry.getNativeType(JSTypeNative.UNKNOWN_TYPE)); } return addValues(builder.build()); }
/** * Returns a new TemplateTypeMap whose values have been extended with the * specified list. */ TemplateTypeMap addValues(ImmutableList<JSType> newValues) { // Ignore any new template values that will not align with an existing // template key. int numUnfilledKeys = numUnfilledTemplateKeys(); if (numUnfilledKeys < newValues.size()) { newValues = newValues.subList(0, numUnfilledKeys); } return registry.createTemplateTypeMap( templateKeys, concatImmutableLists(templateValues, newValues)); }
@Override final boolean hasAnyTemplateTypesInternal() { return getTemplateTypeMap().numUnfilledTemplateKeys() > 0 || typeOfThis.hasAnyTemplateTypes() || call.hasAnyTemplateTypes(); }
@Override public boolean hasAnyTemplateTypesInternal() { return getTemplateTypeMap().numUnfilledTemplateKeys() > 0 || typeOfThis.hasAnyTemplateTypes() || call.hasAnyTemplateTypes(); }
int numKeys = result.getTemplateTypeMap().numUnfilledTemplateKeys(); if (result.isObjectType() && (templateTypes != null && !templateTypes.isEmpty())
!(nonNullableTypeNames.contains(n.getString()))) { Node typeList = n.getFirstChild(); int nAllowedTypes = namedType.getTemplateTypeMap().numUnfilledTemplateKeys(); if (!namedType.isUnknownType() && typeList != null) {
isForwardDeclared ? Integer.MAX_VALUE : namedType.getTemplateTypeMap().numUnfilledTemplateKeys(); boolean recordTemplateArgs = recordUnresolvedTypes && !isForwardDeclared; int templateNodeIndex = 0;