From ac664e7f86593ff3d70576ac475f07f9c91b9ca8 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Mon, 11 Jan 2016 14:25:59 -0600 Subject: final changes to typechecker, the expression compiler, and a couple more tests for good measure --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c63d8297..3909fc6c 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2862,6 +2862,31 @@ BOOST_AUTO_TEST_CASE(invalid_types_in_inline_array) BOOST_CHECK(expectError(text) == Error::Type::TypeError); } +BOOST_AUTO_TEST_CASE(dynamic_inline_array) +{ + char const* text = R"( + contract C { + function f() { + uint[4][4] memory dyn = [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]]; + } + } + )"; + BOOST_CHECK(expectError(text) == Error::Type::TypeError); +} + +BOOST_AUTO_TEST_CASE(lvalues_as_inline_array) +{ + char const* text = R"( + contract C { + function f() { + [1, 2, 3]++; + [1, 2, 3] = [4, 5, 6]; + } + } + )"; + BOOST_CHECK(expectError(text) == Error::Type::TypeError); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit