Reject constant modifier on the fallback function

This commit is contained in:
Alex Beregszaszi
2016-09-06 11:40:00 +01:00
parent f687635e47
commit 6ec40b3cde
4 changed files with 13 additions and 3 deletions
-2
View File
@@ -644,7 +644,6 @@ BOOST_AUTO_TEST_CASE(include_fallback_function)
char const* interface = R"(
[
{
"constant" : false,
"payable": false,
"type" : "fallback"
}
@@ -696,7 +695,6 @@ BOOST_AUTO_TEST_CASE(payable_fallback_unction)
char const* interface = R"(
[
{
"constant" : false,
"payable": true,
"type" : "fallback"
}
@@ -1124,6 +1124,17 @@ BOOST_AUTO_TEST_CASE(fallback_function_with_return_parameters)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
BOOST_AUTO_TEST_CASE(fallback_function_with_constant_modifier)
{
char const* text = R"(
contract C {
uint x;
function() constant { x = 2; }
}
)";
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
BOOST_AUTO_TEST_CASE(fallback_function_twice)
{
char const* text = R"(