remove period between ret type and method name
[org.ibex.classgen.git] / src / org / ibex / classgen / Type.java
index 3d77ba3..441c6fc 100644 (file)
@@ -57,6 +57,7 @@ public abstract class Type implements CGConst {
     public static Type unify(Type t1, Type t2) {
         if(t1 == Type.NULL) return t2;
         if(t2 == Type.NULL) return t1;
+        if((t1 == Type.INT && t2 == Type.BOOLEAN) || (t2 == Type.INT & t1 == Type.BOOLEAN)) return Type.BOOLEAN;
         if(t1 == t2) return t1;
         // FIXME: This needs to do a lot more (subclasses, etc)
         // it probably should be in Context.java
@@ -227,7 +228,7 @@ public abstract class Type implements CGConst {
                     if (name.equals("<init>"))
                         sb.append(Class.this.getShortName());
                     else
-                        sb.append(returnType.toString()).append(".").append(name);
+                        sb.append(returnType.toString()).append(" ").append(name);
                     sb.append("(");
                     for(int i=0; i<argTypes.length; i++)
                         sb.append((i==0?"":", ")+argTypes[i].toString());