Fix T1 & T2 refering to method signature instead of actual types

This commit is contained in:
Daniel Holle 2023-06-22 17:13:01 +02:00
parent f32b1ee5b2
commit 97a1bcbbe1

View File

@ -285,7 +285,7 @@ public abstract class GenerateGenerics {
superType = methodCall.receiverType;
methodCall.receiver.accept(this);
for (int i = 0; i < methodCall.arglist.getArguments().size(); i++) {
superType = methodCall.signature.get(i);
superType = methodCall.arglist.getArguments().get(i).getType();
methodCall.arglist.getArguments().get(i).accept(this);
}
@ -345,7 +345,7 @@ public abstract class GenerateGenerics {
@Override
public void visit(LambdaExpression lambdaExpression) {
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
lambdaExpression.methodBody.accept(this);
}
@ -357,9 +357,9 @@ public abstract class GenerateGenerics {
@Override
public void visit(BinaryExpr binary) {
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
binary.lexpr.accept(this);
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
binary.rexpr.accept(this);
}
@ -373,11 +373,11 @@ public abstract class GenerateGenerics {
@Override
public void visit(IfStmt ifStmt) {
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
ifStmt.expr.accept(this);
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
ifStmt.then_block.accept(this);
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
ifStmt.else_block.accept(this);
}
@ -389,7 +389,7 @@ public abstract class GenerateGenerics {
@Override
public void visit(WhileStmt whileStmt) {
superType = new de.dhbwstuttgart.syntaxtree.type.Void(new NullToken());
superType = new Void(new NullToken());
whileStmt.expr.accept(this);
superType = new Void(new NullToken());
whileStmt.loopBlock.accept(this);