diff --git a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java index 4fa1b0a21..fb1ea80ab 100644 --- a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java +++ b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java @@ -411,6 +411,15 @@ public class ASTToTargetAST { } } } while (foundInfima); + + // Remove duplicate bounds + for (var pair : new HashSet<>(input)) { + if (pair instanceof PairTPHequalRefTypeOrWildcardType) { + if (input.stream().anyMatch(p -> p instanceof PairTPHsmallerTPH && p.getLeft().equals(pair.getLeft()))) { + input.remove(pair); + } + } + } } TargetType get(TypePlaceholder tph) {