mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-08 17:54:40 +00:00
Added line number to type inference errors. Closes #142
This commit is contained in:
parent
5e7d908018
commit
ec863e5c43
@ -26,7 +26,11 @@ public class Pass1TypeInference extends Pass1Base {
|
|||||||
for(Statement statement : block.getStatements()) {
|
for(Statement statement : block.getStatements()) {
|
||||||
if(statement instanceof StatementAssignment) {
|
if(statement instanceof StatementAssignment) {
|
||||||
StatementAssignment assignment = (StatementAssignment) statement;
|
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) {
|
} else if(statement instanceof StatementCall) {
|
||||||
StatementCall call = (StatementCall) statement;
|
StatementCall call = (StatementCall) statement;
|
||||||
String procedureName = call.getProcedureName();
|
String procedureName = call.getProcedureName();
|
||||||
|
Loading…
Reference in New Issue
Block a user