Merge pull request #53 from aaandrewww/master

Fix bug in ClassHierarchy.getLeastCommonSuperClass and imprecision in type inference
This commit is contained in:
Manu Sridharan 2014-06-22 12:08:59 -07:00
commit 8e33a70c91
2 changed files with 5 additions and 1 deletions

View File

@ -49,6 +49,10 @@ public class PointType extends TypeAbstraction {
}
} else if (rhs instanceof ConeType) {
ConeType other = (ConeType) rhs;
if (type.equals(other.getType())) {
// "this" and the cone type have the same underlying type, return the cone type
return other;
}
TypeReference T = other.getType().getReference();
if (type.isArrayClass() || T.isArrayType()) {
// give up on arrays. We don't care anyway.

View File

@ -769,7 +769,7 @@ public class ClassHierarchy implements IClassHierarchy {
}
IClass aa = a;
while (aa != null) {
if (superB.contains(aa)) {
if (b.equals(aa) || superB.contains(aa)) {
return aa;
}
aa = aa.getSuperclass();