aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-15 01:13:56 +0800
committerGitHub <noreply@github.com>2017-09-15 01:13:56 +0800
commit7dd372ce5c9ea1cacf2c70a16f0285bb74314db8 (patch)
tree338fbcdef0accc0605120bc3fca163098d5d74fc /test
parent934b0d2f0daf0a45fb686ec5073dbd288d27f769 (diff)
parent24fd67b7db26f44ddc6b6db0b6f685d887762df0 (diff)
downloaddexon-solidity-7dd372ce5c9ea1cacf2c70a16f0285bb74314db8.tar.gz
dexon-solidity-7dd372ce5c9ea1cacf2c70a16f0285bb74314db8.tar.zst
dexon-solidity-7dd372ce5c9ea1cacf2c70a16f0285bb74314db8.zip
Merge pull request #2904 from ethereum/viewPure5
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 3f02564f..80241519 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"(