aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-28 17:16:44 +0800
committerGitHub <noreply@github.com>2018-03-28 17:16:44 +0800
commit3bb54e8bd5ea75bd52d2eca43fd438f8e894a2de (patch)
tree04577e8e811cdda7555c510326f7215a00d89bb5 /test
parent62559cf1278afc417d19ec181e2bced364cadea2 (diff)
parentb79531bebf67b84fbd2cfe90c1911ec563855afa (diff)
downloaddexon-solidity-3bb54e8bd5ea75bd52d2eca43fd438f8e894a2de.tar.gz
dexon-solidity-3bb54e8bd5ea75bd52d2eca43fd438f8e894a2de.tar.zst
dexon-solidity-3bb54e8bd5ea75bd52d2eca43fd438f8e894a2de.zip
Merge pull request #3775 from federicobond/improve-error-fractional-shift
Improve error message when attempting 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 c5abac03..e5269bc5 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5643,6 +5643,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"(