mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Enforce view with error for experimental 0.5.0.
This commit is contained in:
@@ -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"(
|
||||
|
||||
Reference in New Issue
Block a user