1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00

Added line number to type inference errors. Closes #142

This commit is contained in:
jespergravgaard 2019-03-04 23:55:38 +01:00
parent 5e7d908018
commit ec863e5c43

View File

@ -26,7 +26,11 @@ public class Pass1TypeInference extends Pass1Base {
for(Statement statement : block.getStatements()) {
if(statement instanceof StatementAssignment) {
StatementAssignment assignment = (StatementAssignment) statement;
SymbolTypeInference.inferAssignmentLValue(getProgram(), assignment, false);
try {
SymbolTypeInference.inferAssignmentLValue(getProgram(), assignment, false);
} catch(CompileError e) {
throw new CompileError(e.getMessage(), statement.getSource());
}
} else if(statement instanceof StatementCall) {
StatementCall call = (StatementCall) statement;
String procedureName = call.getProcedureName();