forked from JavaTX/JavaCompilerCore
modified: typeinference/unify/TypeUnifyTask.java
modified: typeinference/unify/model/UnifyPair.java
This commit is contained in:
parent
7e6dee8e1d
commit
6299086297
@ -158,8 +158,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
writeLog("UndefinedPairs; " + undefinedPairs);
|
||||
Set<Set<UnifyPair>> error = new HashSet<>();
|
||||
error.add(undefinedPairs);
|
||||
//return error;
|
||||
return new HashSet<>();
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Up to here, no cartesian products are calculated.
|
||||
@ -363,10 +362,6 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
else {
|
||||
result.addAll(computeCartesianRecursive(elems, remainingSets, eq, fc, parallel));
|
||||
}
|
||||
//if (result.size() == 1) {
|
||||
// System.out.println(result.toString());
|
||||
// result.remove(result.iterator().next());
|
||||
//}
|
||||
if (!result.isEmpty()) {
|
||||
if (variance == 1) {
|
||||
if (a.iterator().next().getLhsType().getName().equals("WL"))
|
||||
@ -400,6 +395,14 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
return result;
|
||||
}
|
||||
|
||||
protected boolean isUndefinedPairSet(Set<Set<UnifyPair>> s) {
|
||||
boolean res = true;
|
||||
if (s.size() ==1) {
|
||||
s.iterator().next().stream().forEach(x -> { res = res && x.isUndefinedPair(); return; });
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Checks whether a set of pairs is in solved form.
|
||||
* @param eqPrimePrime The set of pair
|
||||
|
@ -75,6 +75,10 @@ public class UnifyPair {
|
||||
public void setVariance(byte v) {
|
||||
variance = v;
|
||||
}
|
||||
|
||||
public boolean isUndefinedPair() {
|
||||
return undefinedPair;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if(!(obj instanceof UnifyPair))
|
||||
|
Loading…
Reference in New Issue
Block a user