From b1741b7735fea0f0ee8169bf8e48057bbdaf489d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 18 Sep 2017 11:09:20 +0100 Subject: Validate array length in type checker --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/libsolidity') 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() } -- cgit v1.2.3