From a1f61684b0bf687d15eb95d9d235876cdfa3c6e2 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 15 Dec 2014 16:09:50 +0100 Subject: [PATCH] Check that constructor does not have "returns" directive. --- solidityNameAndTypeResolution.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/solidityNameAndTypeResolution.cpp b/solidityNameAndTypeResolution.cpp index 03eaebb3a..0ea6e51b9 100644 --- a/solidityNameAndTypeResolution.cpp +++ b/solidityNameAndTypeResolution.cpp @@ -284,6 +284,15 @@ BOOST_AUTO_TEST_CASE(assignment_to_struct) BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError); } +BOOST_AUTO_TEST_CASE(returns_in_constructor) +{ + char const* text = "contract test {\n" + " function test() returns (uint a) {\n" + " }\n" + "}\n"; + BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() }