Enforce view with error for experimental 0.5.0.

This commit is contained in:
chriseth
2017-09-14 17:53:43 +02:00
parent 1c85ba10e1
commit 24fd67b7db
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"(