aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-06-04 18:42:55 +0800
committerLiana Husikyan <liana@ethdev.com>2015-06-04 18:42:55 +0800
commit0e664b05aa71641619101de51d16cf5baea6fdf7 (patch)
tree2f25bb3ba01ec5e3a7e1b7ae47c0079079b40bc0 /libsolidity
parentc7e6bbb82c7ad989df59906e8287db852012bbb9 (diff)
downloaddexon-solidity-0e664b05aa71641619101de51d16cf5baea6fdf7.tar.gz
dexon-solidity-0e664b05aa71641619101de51d16cf5baea6fdf7.tar.zst
dexon-solidity-0e664b05aa71641619101de51d16cf5baea6fdf7.zip
- style fixes
- added test for uint8 = -1 which doesn't fail; todo: fix that
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/SolidityNameAndTypeResolution.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp
index a35b7bbe..4f7b82ec 100644
--- a/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -1856,6 +1856,16 @@ BOOST_AUTO_TEST_CASE(positive_integers_to_signed_out_of_bound_max)
BOOST_CHECK_NO_THROW(parseTextAndResolveNames(sourceCode));
}
+BOOST_AUTO_TEST_CASE(negative_integers_to_unsigned)
+{
+ char const* sourceCode = R"(
+ contract test {
+ uint8 public x = -1;
+ }
+ )";
+ BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}