diff options
author | chriseth <chris@ethereum.org> | 2017-06-23 17:56:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-23 17:56:24 +0800 |
commit | 1f7697eee318445e770d4e634477c38685af5110 (patch) | |
tree | 329139d9665742e7fb99661d9b0fd1129a7f7198 /test | |
parent | b00d7a6911e5378d8207a07e7df1ffaf23419c8c (diff) | |
parent | 0fb1621a983025d41ef05d1156bc167ce4490259 (diff) | |
download | dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.tar dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.tar.gz dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.tar.bz2 dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.tar.lz dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.tar.xz dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.tar.zst dexon-solidity-1f7697eee318445e770d4e634477c38685af5110.zip |
Merge pull request #2448 from federicobond/constant-addresses
Fix address literals not being treated as compile-time constants
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 |
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"( |