aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-23 17:19:37 +0800
committerchriseth <chris@ethereum.org>2017-06-23 17:19:57 +0800
commitb86a4cad5702896068459f54993d59a7cd1c889f (patch)
tree0099682a422469d457556c22809ae45009c33598 /test/libsolidity
parent793f05fa3f573f60e7a460245cd7b9cca37d67cc (diff)
downloaddexon-solidity-b86a4cad5702896068459f54993d59a7cd1c889f.tar.gz
dexon-solidity-b86a4cad5702896068459f54993d59a7cd1c889f.tar.zst
dexon-solidity-b86a4cad5702896068459f54993d59a7cd1c889f.zip
Check for constness of address constant.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index c4b1250f..9775d6d0 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2284,6 +2284,16 @@ BOOST_AUTO_TEST_CASE(constant_struct)
CHECK_ERROR(text, TypeError, "implemented");
}
+BOOST_AUTO_TEST_CASE(address_is_constant)
+{
+ char const* text = R"(
+ contract C {
+ address constant x = 0x1212121212121212121212121212121212121212;
+ }
+ )";
+ CHECK_SUCCESS_NO_WARNINGS(text);
+}
+
BOOST_AUTO_TEST_CASE(uninitialized_const_variable)
{
char const* text = R"(