From 87079bd3fdef496fc814a184cb3375e001b03a08 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 16 Oct 2015 16:12:14 +0200 Subject: Correctly parse ambiguities like `A.B[10] x` and `x.y[10] = 3`. --- test/libsolidity/SolidityParser.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/libsolidity/SolidityParser.cpp') diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index c181ae7e..77582a2a 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -1015,6 +1015,24 @@ BOOST_AUTO_TEST_CASE(tuples) BOOST_CHECK(successParse(text)); } +BOOST_AUTO_TEST_CASE(member_access_parser_ambiguity) +{ + char const* text = R"( + contract C { + struct S { uint a; uint b; uint[][][] c; } + function f() { + C.S x; + C.S memory y; + C.S[10] memory z; + C.S[10](x); + x.a = 2; + x.c[1][2][3] = 9; + } + } + )"; + BOOST_CHECK(successParse(text)); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit