Fix inner type variables

This commit is contained in:
Victorious3 2023-02-21 11:31:28 +01:00
parent b58b6c2288
commit 84a5ed2cc3

View File

@ -499,15 +499,17 @@ public class ASTToTargetAST {
// For eliminating inner type variables we need to figure out which ones are actually used // For eliminating inner type variables we need to figure out which ones are actually used
// TODO Maybe don't do this twice? // TODO Maybe don't do this twice?
var referenced = new HashSet<TypePlaceholder>(); var usedTphs = new HashSet<TypePlaceholder>();
for (var param : method.getParameterList().getFormalparalist()) { for (var param : method.getParameterList().getFormalparalist()) {
referenced.addAll(findTypeVariables(param.getType())); usedTphs.addAll(findTypeVariables(param.getType()));
} }
referenced.addAll(findTypeVariables(method.getReturnType())); usedTphs.addAll(findTypeVariables(method.getReturnType()));
var referenced = new HashSet<>(usedTphs);
referenced.addAll(typeVariablesOfClass); referenced.addAll(typeVariablesOfClass);
eliminateInnerTypeVariables(referenced, result); eliminateInnerTypeVariables(referenced, result);
usedTPHsOfMethods.put(method, referenced);
usedTPHsOfMethods.put(method, usedTphs);
System.out.println(method.name + ": " + result); System.out.println(method.name + ": " + result);