Actually replace instead of removing pairs
This commit is contained in:
parent
560f0c5a6f
commit
ef06a8de38
@ -303,11 +303,24 @@ public class ASTToTargetAST {
|
||||
foundInfima = true;
|
||||
var newTph = TypePlaceholder.fresh(new NullToken());
|
||||
input.add(new PairTPHsmallerTPH(left, newTph));
|
||||
input.add(new PairTPHequalRefTypeOrWildcardType(newTph, OBJECT));
|
||||
input.removeAll(infima);
|
||||
for (var infimum : infima) {
|
||||
equality.put(infimum.right, newTph);
|
||||
input.removeIf(pair -> pair.getLeft().equals(infimum.right));
|
||||
new HashSet<>(input).stream().forEach(pair -> {
|
||||
if (pair.getLeft().equals(infimum.right)) {
|
||||
input.remove(pair);
|
||||
if (pair instanceof PairTPHsmallerTPH stph) {
|
||||
input.add(new PairTPHsmallerTPH(newTph, stph.right));
|
||||
} else if (pair instanceof PairTPHequalRefTypeOrWildcardType rtph) {
|
||||
input.add(new PairTPHequalRefTypeOrWildcardType(newTph, rtph.getRight()));
|
||||
}
|
||||
} else if (pair.getRight().equals(infimum.right)) {
|
||||
input.remove(pair);
|
||||
if (pair instanceof PairTPHsmallerTPH stph) {
|
||||
input.add(new PairTPHsmallerTPH(stph.left, newTph));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user