aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-18 01:14:49 +0800
committerchriseth <chris@ethereum.org>2017-10-18 01:14:49 +0800
commit8a8a71de84f5bd71fcea4d31d5a53fde7820ead6 (patch)
treee0e0bc76d0472ed2e05673e2341ce669cd1233a4 /test/libsolidity
parentc99d2aae042643d9d26a4b952e07ca90f11a83c3 (diff)
downloaddexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.gz
dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.tar.zst
dexon-solidity-8a8a71de84f5bd71fcea4d31d5a53fde7820ead6.zip
Only check tuples for valid rational numbers if they have more than one element.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index e9066c32..9b0647bf 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -7106,7 +7106,7 @@ BOOST_AUTO_TEST_CASE(invalid_literal_in_tuple)
}
}
)";
- CHECK_ERROR(text, TypeError, "Invalid rational number.");
+ CHECK_ERROR(text, TypeError, "is not implicitly convertible to expected type");
text = R"(
contract C {
function f() pure public {
@@ -7125,6 +7125,22 @@ BOOST_AUTO_TEST_CASE(invalid_literal_in_tuple)
}
)";
CHECK_ERROR(text, TypeError, "Invalid rational number.");
+ text = R"(
+ contract C {
+ function f() pure public {
+ (2**270, 1);
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Invalid rational number.");
+ text = R"(
+ contract C {
+ function f() pure public {
+ ((2**270) / 2**100, 1);
+ }
+ }
+ )";
+ CHECK_SUCCESS(text);
}
BOOST_AUTO_TEST_CASE(warn_about_sha3)