@Override public JSType caseUnionType(UnionType type) { return type.getRestrictedUnion(getNativeType(NULL_TYPE)); }
@Override public JSType caseUnionType(UnionType type) { return type.getRestrictedUnion(getNativeType(VOID_TYPE)); }
@Override public JSType caseUnionType(UnionType type) { return type.getRestrictedUnion(getNativeType(NULL_TYPE)); }
@Override public JSType caseUnionType(UnionType type) { return type.getRestrictedUnion(getNativeType(VOID_TYPE)); }
/** Gets the string representation of a var args param. */ private void appendVarArgsString(StringBuilder builder, JSType paramType, boolean forAnnotations) { if (paramType.isUnionType()) { // Remove the optionality from the var arg. paramType = paramType.toMaybeUnionType().getRestrictedUnion( registry.getNativeType(JSTypeNative.VOID_TYPE)); } builder.append("...").append( paramType.toStringHelper(forAnnotations)); }
/** Gets the string representation of an optional param. */ private void appendOptionalArgString( StringBuilder builder, JSType paramType, boolean forAnnotations) { if (paramType.isUnionType()) { // Remove the optionality from the var arg. paramType = paramType.toMaybeUnionType().getRestrictedUnion( registry.getNativeType(JSTypeNative.VOID_TYPE)); } builder.append(paramType.toStringHelper(forAnnotations)).append("="); }
private JSType restrictByUndefined(JSType type) { if (type.isUnionType()) { return type.toMaybeUnionType().getRestrictedUnion( (JSType) registry.getNativeType(JSTypeNative.VOID_TYPE)); } return type; } }
/** Gets the string representation of an optional param. */ private void appendOptionalArgString(StringBuilder sb, JSType paramType, boolean forAnnotations) { if (paramType.isUnionType()) { // Remove the optionality from the var arg. paramType = paramType .toMaybeUnionType() .getRestrictedUnion(registry.getNativeType(JSTypeNative.VOID_TYPE)); } paramType.appendAsNonNull(sb, forAnnotations).append("="); }
@Override public JSType caseUnionType(UnionType type) { if (target.isUnknownType()) { return type; } FunctionType funcTarget = target.toMaybeFunctionType(); if (funcTarget.hasInstanceType()) { return type.getRestrictedUnion(funcTarget.getInstanceType()); } return null; }
@Override public JSType caseUnionType(UnionType type) { if (target.isUnknownType()) { return type; } FunctionType funcTarget = target.toMaybeFunctionType(); if (funcTarget.hasInstanceType()) { return type.getRestrictedUnion(funcTarget.getInstanceType()); } return null; }
type = type.toMaybeUnionType().getRestrictedUnion( getNativeType(BOOLEAN_TYPE));
type = type.toMaybeUnionType().getRestrictedUnion( getNativeType(BOOLEAN_TYPE));