diff options
author | chriseth <c@ethdev.com> | 2014-12-19 05:24:44 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2014-12-19 05:24:44 +0800 |
commit | 7795b2a89215686eddf9bdf3e2057295d9ba67af (patch) | |
tree | 7ac7a7fe2cfe613f500293c49eca5bba2832287a | |
parent | da29d945e21b0519b75b8c06107d3b903427d051 (diff) | |
parent | f96578196e765d04a74112b842fb048942275883 (diff) | |
download | dexon-solidity-7795b2a89215686eddf9bdf3e2057295d9ba67af.tar.gz dexon-solidity-7795b2a89215686eddf9bdf3e2057295d9ba67af.tar.zst dexon-solidity-7795b2a89215686eddf9bdf3e2057295d9ba67af.zip |
Merge pull request #655 from chriseth/sol_precedence
Bit operators should bind more strongly than comparison operators.
-rw-r--r-- | SolidityNameAndTypeResolution.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp index 0bda0a1f..25bff71f 100644 --- a/SolidityNameAndTypeResolution.cpp +++ b/SolidityNameAndTypeResolution.cpp @@ -311,6 +311,16 @@ BOOST_AUTO_TEST_CASE(forward_function_reference) BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text)); } +BOOST_AUTO_TEST_CASE(comparison_bitop_precedence) +{ + char const* text = "contract First {\n" + " function fun() returns (bool ret) {\n" + " return 1 & 2 == 8 & 9 && 1 ^ 2 < 4 | 6;\n" + " }\n" + "}\n"; + BOOST_CHECK_NO_THROW(parseTextAndResolveNames(text)); +} + BOOST_AUTO_TEST_SUITE_END() } |