forked from JavaTX/JavaCompilerCore
Generics fix
This commit is contained in:
parent
f7160c10f4
commit
e972282620
@ -427,6 +427,9 @@ public class SyntaxTreeGenerator{
|
|||||||
GenericsRegistry ret = new GenericsRegistry(this.globalGenerics);
|
GenericsRegistry ret = new GenericsRegistry(this.globalGenerics);
|
||||||
ret.putAll(generics);
|
ret.putAll(generics);
|
||||||
if(ctx == null || ctx.typeParameterList() == null)return ret;
|
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()){
|
for(Java8Parser.TypeParameterContext tp : ctx.typeParameterList().typeParameter()){
|
||||||
TypeGenerator.convert(tp, parentClass, parentMethod, reg, ret);
|
TypeGenerator.convert(tp, parentClass, parentMethod, reg, ret);
|
||||||
}
|
}
|
||||||
|
@ -59,10 +59,6 @@ public class TypeGenerator {
|
|||||||
|
|
||||||
public static GenericDeclarationList convert(Java8Parser.TypeParametersContext typeParametersContext,
|
public static GenericDeclarationList convert(Java8Parser.TypeParametersContext typeParametersContext,
|
||||||
JavaClassName parentClass, String parentMethod, JavaClassRegistry reg, GenericsRegistry generics) {
|
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();
|
Token endOffset = typeParametersContext.getStop();
|
||||||
List<GenericTypeVar> typeVars = new ArrayList<>();
|
List<GenericTypeVar> typeVars = new ArrayList<>();
|
||||||
for(Java8Parser.TypeParameterContext typeParameter : typeParametersContext.typeParameterList().typeParameter()){
|
for(Java8Parser.TypeParameterContext typeParameter : typeParametersContext.typeParameterList().typeParameter()){
|
||||||
|
Loading…
Reference in New Issue
Block a user