From ead0478f268f486ea8e9eccac729c93cf4a94ee1 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 16 Oct 2015 14:34:43 +0200 Subject: Fix errors when struct array type is used on its own. --- test/libsolidity/SolidityEndToEndTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/libsolidity/SolidityEndToEndTest.cpp') diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 75e43b73..27c511f2 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -5772,6 +5772,21 @@ BOOST_AUTO_TEST_CASE(destructuring_assignment_wildcard) BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0))); } +BOOST_AUTO_TEST_CASE(lone_struct_array_type) +{ + char const* sourceCode = R"( + contract C { + struct s { uint a; uint b;} + function f() returns (uint) { + s[7][]; // This is only the type, should not have any effect + return 3; + } + } + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(3))); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit