@Override public Boolean caseTemplatizedType( TemplatizedType thisType, JSType thatType) { // TODO(johnlenz): once the templated type work is finished, // restrict the type parameters. return thisType.getReferencedTypeInternal().visit(this, thatType); }
@Override public Boolean caseTemplatizedType( TemplatizedType thisType, JSType thatType) { // TODO(johnlenz): once the templated type work is finished, // restrict the type parameters. return thisType.getReferencedTypeInternal().visit(this, thatType); }
boolean wrapsSameRawType(JSType that) { return that.isTemplatizedType() && this.getReferencedTypeInternal() .isEquivalentTo( that.toMaybeTemplatizedType().getReferencedTypeInternal()); }
boolean wrapsSameRawType(JSType that) { return that.isTemplatizedType() && this.getReferencedTypeInternal() .isEquivalentTo( that.toMaybeTemplatizedType().getReferencedTypeInternal()); }
Boolean castCastToHelper(JSType thisType, JSType thatType) { if (thatType.isUnknownType() || thatType.isAllType() || thatType.isNoObjectType() // TODO(johnlenz): restrict to objects || thatType.isNoType()) { return true; } else if (thisType.isRecordType() || thatType.isRecordType()) { return true; // TODO(johnlenz): are there any misuses we can catch? } else if (isInterface(thisType) || isInterface(thatType)) { return true; // TODO(johnlenz): are there any misuses we can catch? } else if (thatType.isEnumElementType()) { return thisType.visit(this, thatType.toMaybeEnumElementType().getPrimitiveType()); } else if (thatType.isUnionType()) { return canCastToUnion(thisType, thatType.toMaybeUnionType()); } else if (thatType.isFunctionType()) { return canCastToFunction(thisType, thatType.toMaybeFunctionType()); } else if (thatType.isTemplatizedType()) { // TODO(johnlenz): once the templated type work is finished, // restrict the type parameters. return thisType.visit(this, thatType.toMaybeTemplatizedType().getReferencedTypeInternal()); } return thisType.isSubtypeOf(thatType) || thatType.isSubtypeOf(thisType); }
Boolean castCastToHelper(JSType thisType, JSType thatType) { if (thatType.isUnknownType() || thatType.isAllType() || thatType.isNoObjectType() // TODO(johnlenz): restrict to objects || thatType.isNoType()) { return true; } else if (thisType.isRecordType() || thatType.isRecordType()) { return true; // TODO(johnlenz): are there any misuses we can catch? } else if (isInterface(thisType) || isInterface(thatType)) { return true; // TODO(johnlenz): are there any misuses we can catch? } else if (thatType.isEnumElementType()) { return thisType.visit(this, thatType.toMaybeEnumElementType().getPrimitiveType()); } else if (thatType.isUnionType()) { return canCastToUnion(thisType, thatType.toMaybeUnionType()); } else if (thatType.isFunctionType()) { return canCastToFunction(thisType, thatType.toMaybeFunctionType()); } else if (thatType.isTemplatizedType()) { // TODO(johnlenz): once the templated type work is finished, // restrict the type parameters. return thisType.visit(this, thatType.toMaybeTemplatizedType().getReferencedTypeInternal()); } return thisType.isSubtype(thatType) || thatType.isSubtype(thisType); }