public void updateType() { Type leftType = Type.tSuperType(subExpressions[0].getType()); Type rightType = Type.tSuperType(subExpressions[1].getType()); compareType = compareType.intersection(leftType).intersection(rightType); subExpressions[0].setType(Type.tSubType(rightType)); subExpressions[1].setType(Type.tSubType(leftType)); /* propagate hints? XXX */ }
public String getTypeString(Type type) { if (type instanceof ArrayType) return getTypeString(((ArrayType) type).getElementType()) + "[]"; else if (type instanceof ClassInterfacesType) { ClassInfo clazz = ((ClassInterfacesType) type).getClassInfo(); return getClassString(clazz, Scope.CLASSNAME); } else if (type instanceof NullType) return "Object"; else return type.toString(); }
public void updateSubTypes() { subExpressions[0].setType(Type.tSubType(compareType)); subExpressions[1].setType(Type.tSubType(compareType)); }