Reduce the types of errors outputted by ConstantEvaluator

This commit is contained in:
Alex Beregszaszi
2017-12-12 09:40:29 +00:00
parent 5226d54ed1
commit 7ff9a85592
2 changed files with 10 additions and 12 deletions
@@ -7419,25 +7419,25 @@ BOOST_AUTO_TEST_CASE(array_length_invalid_expression)
uint[-true] ids;
}
)";
CHECK_ERROR(text, TypeError, "Invalid constant expression.");
CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
text = R"(
contract C {
uint[true/1] ids;
}
)";
CHECK_ERROR(text, TypeError, "Invalid constant expression.");
CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
text = R"(
contract C {
uint[1/true] ids;
}
)";
CHECK_ERROR(text, TypeError, "Invalid constant expression.");
CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
text = R"(
contract C {
uint[1.111111E1111111111111] ids;
}
)";
CHECK_ERROR(text, TypeError, "Invalid literal value.");
CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
text = R"(
contract C {
uint[3/0] ids;