TESTEN OB DAS SINN MACHT
modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java modified: src/test/java/AllgemeinTest.java
This commit is contained in:
parent
a15cbcba7b
commit
dfd91b5f8b
@ -371,6 +371,21 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
do {
|
||||
eq0Prime = eqSubst.get();
|
||||
eq0 = applyTypeUnificationRules(eq0Prime, fc);
|
||||
Set<UnifyPair> occurcheck = new HashSet<>(eq0);
|
||||
occurcheck.removeAll(eq0Prime);
|
||||
ocurrPairs = occurcheck.stream().filter(x -> {
|
||||
UnifyType lhs, rhs;
|
||||
return (lhs = x.getLhsType()) instanceof PlaceholderType
|
||||
&& !((rhs = x.getRhsType()) instanceof PlaceholderType)
|
||||
&& rhs.getTypeParams().occurs((PlaceholderType)lhs);})
|
||||
.map(x -> { x.setUndefinedPair(); return x;})
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
writeLog("ocurrPairs: " + ocurrPairs);
|
||||
if (ocurrPairs.size() > 0) {
|
||||
Set<Set<UnifyPair>> ret = new HashSet<>();
|
||||
ret.add(ocurrPairs);
|
||||
return ret;
|
||||
}
|
||||
eqSubst = rules.subst(eq0, oderConstraints);
|
||||
} while (eqSubst.isPresent());
|
||||
|
||||
|
@ -41,6 +41,7 @@ public class AllgemeinTest {
|
||||
//String className = "Var";
|
||||
//String className = "Put";
|
||||
//String className = "Twice";
|
||||
//String className = "Twice2";
|
||||
//String className = "TestSubTypless";
|
||||
//String className = "addList";
|
||||
//String className = "M";
|
||||
@ -56,7 +57,8 @@ public class AllgemeinTest {
|
||||
//String className = "UseWildcardPair";
|
||||
//String className = "Assign";
|
||||
//String className = "StreamTest";
|
||||
String className = "Iteration";
|
||||
//String className = "Iteration";
|
||||
String className = "Cycle";
|
||||
//PL 2019-10-24: genutzt fuer unterschiedliche Tests
|
||||
path = System.getProperty("user.dir")+"/resources/AllgemeinTest/" + className + ".jav";
|
||||
//path = System.getProperty("user.dir")+"/src/test/resources/AllgemeinTest/Overloading_Generics.jav";
|
||||
|
Loading…
Reference in New Issue
Block a user