modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

disableCondWildcards wird aufgerufen

	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
/**
	 * wenn in einem  Paar bestehend aus 2 Typvariablen eine nicht wildcardtable ist,
	 * so beide auf nicht wildcardtable setzen
	 */
	public void disableCondWildcards()
eingefuegt
This commit is contained in:
Martin Plümicke 2019-03-07 13:37:08 +01:00
parent b46e0b855c
commit 94c32609c6
2 changed files with 11 additions and 0 deletions

View File

@ -531,6 +531,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
Set<UnifyPair> eq0 = applyTypeUnificationRules(eq, fc);
eq0.forEach(x -> x.disableCondWildcards());
/*
* Step 2 and 3: Create a subset eq1s of pairs where both sides are TPH and eq2s of the other pairs

View File

@ -177,6 +177,16 @@ public class UnifyPair {
}
}
public void disableCondWildcards() {
if (lhs instanceof PlaceholderType && rhs instanceof PlaceholderType
&& (!((PlaceholderType)lhs).isWildcardable() || !((PlaceholderType)rhs).isWildcardable()))
{
((PlaceholderType)lhs).disableWildcardtable();
((PlaceholderType)rhs).disableWildcardtable();
}
}
public Boolean wrongWildcard() {
return lhs.wrongWildcard() || rhs.wrongWildcard();
}