1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-10 12:31:09 +00:00

Improved error message. See #622

This commit is contained in:
jespergravgaard 2021-01-20 19:02:32 +01:00
parent 47f4e03835
commit 53bdb9d60b
2 changed files with 5 additions and 5 deletions

View File

@ -1111,7 +1111,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
throw new CompileError("Variable used before being defined " + initValue.toString(), statementSource);
}
if(!(initValue instanceof ConstantValue))
throw new CompileError("Initializer is not a constant value " + initValue.toString(), statementSource);
throw new CompileError("Initializer is not a constant value.", statementSource);
return (ConstantValue) initValue;
}

View File

@ -84,10 +84,10 @@ public class TestPrograms {
compileAndCompare("missing-band.c");
}
//@Test
//public void testUnknownVarProblem2() throws IOException, URISyntaxException {
// compileAndCompare("unknown-var-problem-2.c", log().verboseParse());
//}
@Test
public void testUnknownVarProblem2() throws IOException, URISyntaxException {
assertError("unknown-var-problem-2.c", "error: Initializer is not a constant value.");
}
// https://gitlab.com/camelot/kickc/-/issues/564
//@Test