diff options
author | chriseth <c@ethdev.com> | 2015-10-16 22:12:14 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-10-16 22:12:25 +0800 |
commit | 87079bd3fdef496fc814a184cb3375e001b03a08 (patch) | |
tree | db4fc6b668892b7b25155362becf2b5ea56af556 /test/libsolidity/SolidityParser.cpp | |
parent | 452d4732937f418d9c0b5152050c13aa48b7fdde (diff) | |
download | dexon-solidity-87079bd3fdef496fc814a184cb3375e001b03a08.tar.gz dexon-solidity-87079bd3fdef496fc814a184cb3375e001b03a08.tar.zst dexon-solidity-87079bd3fdef496fc814a184cb3375e001b03a08.zip |
Correctly parse ambiguities like `A.B[10] x` and `x.y[10] = 3`.
Diffstat (limited to 'test/libsolidity/SolidityParser.cpp')
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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() } |