Пример #1
0
 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 */
 }
Пример #2
0
 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();
 }
Пример #3
0
 public void updateSubTypes() {
   subExpressions[0].setType(Type.tSubType(compareType));
   subExpressions[1].setType(Type.tSubType(compareType));
 }