aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-11 23:18:03 +0800
committerGitHub <noreply@github.com>2016-11-11 23:18:03 +0800
commit6248e92d77673eaf2c851b9dd0b1811248a24b58 (patch)
tree174bed458bfe9d1e1dd9e4a7a45387cbcf5d262d /test
parenta40dcfef1257c4b159eb8248ecb0f837b42d8ead (diff)
parent41170d55075fc056a688dc8fb29021e23b645cc0 (diff)
downloaddexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.tar
dexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.tar.gz
dexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.tar.bz2
dexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.tar.lz
dexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.tar.xz
dexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.tar.zst
dexon-solidity-6248e92d77673eaf2c851b9dd0b1811248a24b58.zip
Merge pull request #1293 from ethereum/common_type_of_rational_type
tolerant type checking for inline arrays, by computing the common type in a more tolerant way
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index a1430b02..bab54fab 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -6353,6 +6353,20 @@ BOOST_AUTO_TEST_CASE(decayed_tuple)
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(2)));
}
+BOOST_AUTO_TEST_CASE(inline_tuple_with_rational_numbers)
+{
+ char const* sourceCode = R"(
+ contract c {
+ function f() returns (int8) {
+ int8[5] memory foo3 = [int8(1), -1, 0, 0, 0];
+ return foo3[0];
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(1)));
+}
+
BOOST_AUTO_TEST_CASE(destructuring_assignment)
{
char const* sourceCode = R"(