aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-06 00:33:52 +0800
committerchriseth <chris@ethereum.org>2017-09-06 19:52:29 +0800
commitb756274357c1e33517d535fdd2349a88221d4780 (patch)
treecbd1cbaaa93d1e45df651bd1030f0bc5965985ec /test/libsolidity
parent15bdc48a73d1cbebb9f75830fd1abbd29f798c12 (diff)
downloaddexon-solidity-b756274357c1e33517d535fdd2349a88221d4780.tar.gz
dexon-solidity-b756274357c1e33517d535fdd2349a88221d4780.tar.zst
dexon-solidity-b756274357c1e33517d535fdd2349a88221d4780.zip
Allow constant variables in pure functions.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/ViewPureChecker.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index 6e99260c..9cea9850 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -378,6 +378,19 @@ BOOST_AUTO_TEST_CASE(assembly_jump)
CHECK_WARNING(text, "low-level EVM features");
}
+BOOST_AUTO_TEST_CASE(constant)
+{
+ string text = R"(
+ contract C {
+ uint constant x = 2;
+ function k() pure returns (uint) {
+ return x;
+ }
+ }
+ )";
+ CHECK_SUCCESS_NO_WARNINGS(text);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}