aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2018-02-12 06:44:23 +0800
committerFederico Bond <federicobond@gmail.com>2018-02-12 08:40:41 +0800
commit75a3a707a243ccb6135c7931bb32ac7b44551082 (patch)
tree435af7721119cf12f952890e280e48d380a5510f /test
parent2095e7a32dce04f6142074bf96f14b6c7046137a (diff)
downloaddexon-solidity-75a3a707a243ccb6135c7931bb32ac7b44551082.tar.gz
dexon-solidity-75a3a707a243ccb6135c7931bb32ac7b44551082.tar.zst
dexon-solidity-75a3a707a243ccb6135c7931bb32ac7b44551082.zip
Fix segfault with undeclared array types
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 e8405281..ee6a0633 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2196,6 +2196,16 @@ BOOST_AUTO_TEST_CASE(array_copy_with_different_types_dynamic_static)
CHECK_ERROR(text, TypeError, "Type uint256[] storage ref is not implicitly convertible to expected type uint256[80] storage ref.");
}
+BOOST_AUTO_TEST_CASE(array_of_undeclared_type)
+{
+ char const* text = R"(
+ contract c {
+ a[] public foo;
+ }
+ )";
+ CHECK_ERROR(text, DeclarationError, "Identifier not found or not unique.");
+}
+
BOOST_AUTO_TEST_CASE(storage_variable_initialization_with_incorrect_type_int)
{
char const* text = R"(