aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-03-01 23:58:20 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-03-01 23:58:55 +0800
commitbd4c2b9bde02b94d367ad9af6e44b9434bb1bb93 (patch)
treed5e7c0cf5e6e016f6c0ab391d6cda49a2150978a /test/libsolidity
parent9e3da89a7a0753e869b4668f9587385c9b37ba8d (diff)
downloaddexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.tar
dexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.tar.gz
dexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.tar.bz2
dexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.tar.lz
dexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.tar.xz
dexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.tar.zst
dexon-solidity-bd4c2b9bde02b94d367ad9af6e44b9434bb1bb93.zip
Deprecate using unit denominations in combination with hex numbers. Closes #3574.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 8c2d853c..eeefe818 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2717,6 +2717,25 @@ BOOST_AUTO_TEST_CASE(explicit_conversion_from_decimal_to_bytesxx)
CHECK_SUCCESS_NO_WARNINGS(text);
}
+BOOST_AUTO_TEST_CASE(combining_hex_and_denomination)
+{
+ char const* text = R"(
+ contract Foo {
+ uint constant x = 0x01 wei;
+ }
+ )";
+ CHECK_WARNING(text, "Hexadecimal numbers with unit denominations are deprecated.");
+
+ char const* textV050 = R"(
+ pragma experimental "v0.5.0";
+
+ contract Foo {
+ uint constant x = 0x01 wei;
+ }
+ )";
+ CHECK_ERROR(textV050, TypeError, "Hexadecimal numbers cannot be used with unit denominations.");
+}
+
BOOST_AUTO_TEST_CASE(assigning_value_to_const_variable)
{
char const* text = R"(