diff options
author | chriseth <c@ethdev.com> | 2016-09-16 00:01:13 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-16 00:16:34 +0800 |
commit | 031fd568cc753c2ac21e651eaadf2381b2585191 (patch) | |
tree | da1d28fb0a26a89eb001544c72834efcbd76a328 /test | |
parent | 6a80511ffb63a69589252e26be62d18d6281c8ae (diff) | |
download | dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.tar dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.tar.gz dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.tar.bz2 dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.tar.lz dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.tar.xz dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.tar.zst dexon-solidity-031fd568cc753c2ac21e651eaadf2381b2585191.zip |
Fix crash for TypeName[k].
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 58736025..b8c64336 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -4009,6 +4009,16 @@ BOOST_AUTO_TEST_CASE(external_constructor) BOOST_CHECK(expectError(text, false) == Error::Type::TypeError); } +BOOST_AUTO_TEST_CASE(invalid_array_as_statement) +{ + char const* text = R"( + contract test { + struct S { uint x; } + function test(uint k) { S[k]; } + } + )"; + BOOST_CHECK(expectError(text, false) == Error::Type::TypeError); +} BOOST_AUTO_TEST_SUITE_END() |