From 07cc84fadee7f1f86467a8dba435b2d5b28db268 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 13 Jun 2017 16:42:58 +0200 Subject: Fix a crash about a non-callable expression. --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'test') 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() } -- cgit v1.2.3