Code to improve search by pruning certain types of repair..
[repair.git] / Repair / RepairCompiler / MCC / IR / InclusionPredicate.java
index 4fda86c2b3ce6647b07cfbce24c463f06feee6a3..c99715d335a716f1dee7e0cf32621dc35f2433e2 100755 (executable)
@@ -10,9 +10,17 @@ public class InclusionPredicate extends Predicate {
     public TypeDescriptor typecheck(SemanticAnalyzer sa) {
        TypeDescriptor t=expr.typecheck(sa);
        TypeDescriptor ts=setexpr.typecheck(sa);
-       if (t!=ts)
+       if (t instanceof StructureTypeDescriptor) {
+           while(((StructureTypeDescriptor)t).getSuperType()!=null)
+               t=((StructureTypeDescriptor)t).getSuperType();
+       }
+       if (ts instanceof StructureTypeDescriptor) {
+           while(((StructureTypeDescriptor)ts).getSuperType()!=null)
+               ts=((StructureTypeDescriptor)ts).getSuperType();
+       }
+       if (t!=ts) {
            return null;
-       
+       }
        return ReservedTypeDescriptor.INT;
     }