aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-13 22:42:58 +0800
committerchriseth <chris@ethereum.org>2017-06-14 20:26:20 +0800
commit07cc84fadee7f1f86467a8dba435b2d5b28db268 (patch)
tree2648b4405d12f9d5f8d53f92a15b4d05ae81752c /test
parentd3f4c97c533b2f64dda9fe7bdf5848f6c8bbb300 (diff)
downloaddexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.tar
dexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.tar.gz
dexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.tar.bz2
dexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.tar.lz
dexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.tar.xz
dexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.tar.zst
dexon-solidity-07cc84fadee7f1f86467a8dba435b2d5b28db268.zip
Fix a crash about a non-callable expression.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index ba2ade66..dddb5dde 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5785,6 +5785,20 @@ BOOST_AUTO_TEST_CASE(no_unused_inline_asm)
CHECK_SUCCESS_NO_WARNINGS(text);
}
+BOOST_AUTO_TEST_CASE(callable_crash)
+{
+ char const* text = R"(
+ contract C {
+ struct S { uint a; bool x; }
+ S public s;
+ function C() {
+ 3({a: 1, x: true});
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Type is not callable");
+}
+
BOOST_AUTO_TEST_CASE(returndatacopy_as_variable)
{
char const* text = R"(
@@ -5802,7 +5816,6 @@ BOOST_AUTO_TEST_CASE(shadowing_warning_can_be_removed)
}
-
BOOST_AUTO_TEST_SUITE_END()
}