Throw exception if class doesn't exist
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 3m11s

This commit is contained in:
Daniel Holle 2024-04-10 10:03:59 +02:00
parent ec890356e4
commit b752219d8c

View File

@ -1,5 +1,6 @@
package de.dhbwstuttgart.target.generate;
import de.dhbwstuttgart.exceptions.DebugException;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
@ -214,7 +215,7 @@ public class StatementToTargetExpression implements ASTVisitor {
foundMethod = thisMethod.orElseGet(() -> findMethod(finalReceiverClass.getSuperClass().getName(), methodCall.name, signature).orElseThrow());
} else if (!isFunNType) {
receiverClass = converter.compiler.getClass(receiverName);
System.out.println(receiverClass.getClassName() + " " + signature);
if (receiverClass == null) throw new DebugException("Class " + receiverName + " does not exist!");
foundMethod = findMethod(receiverName, methodCall.name, signature).orElseThrow();
}