Generics fix

This commit is contained in:
JanUlrich 2018-05-30 16:10:20 +02:00 committed by Aldaron7
parent f7160c10f4
commit e972282620
2 changed files with 3 additions and 4 deletions

View File

@ -427,6 +427,9 @@ public class SyntaxTreeGenerator{
GenericsRegistry ret = new GenericsRegistry(this.globalGenerics);
ret.putAll(generics);
if(ctx == null || ctx.typeParameterList() == null)return ret;
for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){
ret.put(tp.Identifier().getText(), new GenericContext(parentClass, parentMethod));
}
for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){
TypeGenerator.convert(tp, parentClass, parentMethod, reg, ret);
}

View File

@ -59,10 +59,6 @@ public class TypeGenerator {
public static GenericDeclarationList convert(Java8Parser.TypeParametersContext typeParametersContext,
JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
for(Java8Parser.TypeParameterContext tp : typeParametersContext.typeParameterList().typeParameter()){
generics.put(tp.Identifier().getText(), new GenericContext(parentClass, parentMethod));
}
Token endOffset = typeParametersContext.getStop();
List<GenericTypeVar> typeVars = new ArrayList<>();
for(Java8Parser.TypeParameterContext typeParameter : typeParametersContext.typeParameterList().typeParameter()){