aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2018-03-22 12:20:50 +0800
committerFederico Bond <federicobond@gmail.com>2018-03-22 21:05:49 +0800
commitb79531bebf67b84fbd2cfe90c1911ec563855afa (patch)
treec88d3e68e3b25f9a957244b73f4c9a4223a0bfb6 /test
parentba209fe485ba40ea3926800bc90932bec40cd16f (diff)
downloaddexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.tar
dexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.tar.gz
dexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.tar.bz2
dexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.tar.lz
dexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.tar.xz
dexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.tar.zst
dexon-solidity-b79531bebf67b84fbd2cfe90c1911ec563855afa.zip
Improve error message when trying to shift by fractional number
Diffstat (limited to 'test')
-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 50ee2b2e..ab6113dd 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5866,6 +5866,16 @@ BOOST_AUTO_TEST_CASE(shift_constant_right_excessive_rvalue)
CHECK_ERROR(text, TypeError, "Operator >> not compatible with types int_const 66 and int_const 4294967296");
}
+BOOST_AUTO_TEST_CASE(shift_constant_right_fractional)
+{
+ char const* text = R"(
+ contract C {
+ uint public a = 0x42 >> (1 / 2);
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Operator >> not compatible with types int_const 66 and rational_const 1 / 2");
+}
+
BOOST_AUTO_TEST_CASE(inline_assembly_unbalanced_positive_stack)
{
char const* text = R"(