Add iteration and replacement of nested type parameters

This commit is contained in:
Till Schnell 2021-04-08 18:08:38 +02:00
parent c474abd2bd
commit 81697eee64

View File

@ -49,11 +49,22 @@ public class ReplaceTypeparamVisitor
// If Parameter type is RefType replace with TPH // If Parameter type is RefType replace with TPH
if (next instanceof RefType) { if (next instanceof RefType) {
RefType nextRefType = (RefType) next; 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); TypePlaceholder tph = generateTypePlaceholder(nextRefType);
// Replace in AST
listIterator.set(tph); listIterator.set(tph);
} }
} }
} }
// Let the parent care about all the other stuff
super.visit(refType); super.visit(refType);
} }