aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-14 23:53:43 +0800
committerchriseth <chris@ethereum.org>2017-09-14 23:53:43 +0800
commit24fd67b7db26f44ddc6b6db0b6f685d887762df0 (patch)
tree3982eca046948d719e4dd824aa82b3573db2a244 /test
parent1c85ba10e13879f680579031234c911099433596 (diff)
downloaddexon-solidity-24fd67b7db26f44ddc6b6db0b6f685d887762df0.tar.gz
dexon-solidity-24fd67b7db26f44ddc6b6db0b6f685d887762df0.tar.zst
dexon-solidity-24fd67b7db26f44ddc6b6db0b6f685d887762df0.zip
Enforce view with error for experimental 0.5.0.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/ViewPureChecker.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index 9cea9850..cdb752cd 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -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"(