Throw exception if class doesn't exist
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 3m11s
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 3m11s
This commit is contained in:
parent
ec890356e4
commit
b752219d8c
@ -1,5 +1,6 @@
|
|||||||
package de.dhbwstuttgart.target.generate;
|
package de.dhbwstuttgart.target.generate;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.exceptions.DebugException;
|
||||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||||
import de.dhbwstuttgart.parser.NullToken;
|
import de.dhbwstuttgart.parser.NullToken;
|
||||||
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
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());
|
foundMethod = thisMethod.orElseGet(() -> findMethod(finalReceiverClass.getSuperClass().getName(), methodCall.name, signature).orElseThrow());
|
||||||
} else if (!isFunNType) {
|
} else if (!isFunNType) {
|
||||||
receiverClass = converter.compiler.getClass(receiverName);
|
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();
|
foundMethod = findMethod(receiverName, methodCall.name, signature).orElseThrow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user