aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-09-17 17:28:44 +0800
committerGitHub <noreply@github.com>2016-09-17 17:28:44 +0800
commit0bc8476aeaac94f44d85d72865c142ac4151967f (patch)
tree8543da5568ebcea7f75245619ec5e777c520e7ba /test
parent62f13ad8bf1f7f33bc90bb5c1e1b1e001032501d (diff)
parent031fd568cc753c2ac21e651eaadf2381b2585191 (diff)
downloaddexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.tar
dexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.tar.gz
dexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.tar.bz2
dexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.tar.lz
dexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.tar.xz
dexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.tar.zst
dexon-solidity-0bc8476aeaac94f44d85d72865c142ac4151967f.zip
Merge pull request #1101 from ethereum/fixcrash
Fix crash for TypeName[k].
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp10
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()