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:
parent
47f4e03835
commit
53bdb9d60b
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user