From 81697eee641987ec43f8f0f23bec691563fdc117 Mon Sep 17 00:00:00 2001 From: Till Schnell Date: Thu, 8 Apr 2021 18:08:38 +0200 Subject: [PATCH] Add iteration and replacement of nested type parameters --- .../inferWildcards/ReplaceTypeparamVisitor.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/de/dhbwstuttgart/inferWildcards/ReplaceTypeparamVisitor.java b/src/main/java/de/dhbwstuttgart/inferWildcards/ReplaceTypeparamVisitor.java index 01ef4214..b7483f70 100644 --- a/src/main/java/de/dhbwstuttgart/inferWildcards/ReplaceTypeparamVisitor.java +++ b/src/main/java/de/dhbwstuttgart/inferWildcards/ReplaceTypeparamVisitor.java @@ -49,11 +49,22 @@ public class ReplaceTypeparamVisitor // If Parameter type is RefType replace with TPH if (next instanceof RefType) { RefType nextRefType = (RefType) next; + + // Visit replaced RefType to get all nested type parameters + // Should be done before generating parents TPH to include child TPH in the + // parent TPH mapping + this.visit(nextRefType); + + // Generate TPH TypePlaceholder tph = generateTypePlaceholder(nextRefType); + + // Replace in AST listIterator.set(tph); } } } + + // Let the parent care about all the other stuff super.visit(refType); }