Merge pull request #2904 from ethereum/viewPure5

Enforce view with error for experimental 0.5.0.
This commit is contained in:
Alex Beregszaszi
2017-09-14 18:13:56 +01:00
committed by GitHub
4 changed files with 35 additions and 11 deletions
+10
View File
@@ -143,6 +143,16 @@ BOOST_AUTO_TEST_CASE(environment_access)
}
}
BOOST_AUTO_TEST_CASE(view_error_for_050)
{
CHECK_ERROR(
"pragma experimental \"v0.5.0\"; contract C { uint x; function f() view { x = 2; } }",
TypeError,
"Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable."
);
}
BOOST_AUTO_TEST_CASE(modifiers)
{
string text = R"(