aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-18 18:09:20 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-29 23:44:00 +0800
commitb1741b7735fea0f0ee8169bf8e48057bbdaf489d (patch)
tree4368cc9ea3c65fed9e55b98bb6b03db80d91a7b0 /test/libsolidity
parentf3fe043cc13ac76a7ca02285a54f973a4dc4461d (diff)
downloaddexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar
dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.gz
dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.bz2
dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.lz
dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.xz
dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.tar.zst
dexon-solidity-b1741b7735fea0f0ee8169bf8e48057bbdaf489d.zip
Validate array length in type checker
Diffstat (limited to 'test/libsolidity')
-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 959bc4ff..91c2adb1 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -6976,6 +6976,16 @@ BOOST_AUTO_TEST_CASE(address_overload_resolution)
CHECK_SUCCESS(text);
}
+BOOST_AUTO_TEST_CASE(array_length_validation)
+{
+ char const* text = R"(
+ contract C {
+ uint[8**90] ids;
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal.");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}