projects
/
org.ibex.classgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38a8895
)
more type unification
author
brian
<brian@brianweb.net>
Mon, 4 Jul 2005 01:36:38 +0000
(
01:36
+0000)
committer
brian
<brian@brianweb.net>
Mon, 4 Jul 2005 01:36:38 +0000
(
01:36
+0000)
darcs-hash:
20050704013638
-24bed-
5a85f357f167f85cd9eb9b367371c9ca166a8d34
.gz
src/org/ibex/classgen/Type.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/classgen/Type.java
b/src/org/ibex/classgen/Type.java
index
3d77ba3
..
7463f04
100644
(file)
--- a/
src/org/ibex/classgen/Type.java
+++ b/
src/org/ibex/classgen/Type.java
@@
-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