aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-15 23:09:50 +0800
committerChristian <c@ethdev.com>2014-12-15 23:09:50 +0800
commita1f61684b0bf687d15eb95d9d235876cdfa3c6e2 (patch)
treec8676ded2f33badbefe4b69f63ad323b5ed25ca4
parent17c433e7c9cbf6ceea61dc6040733f85eb3eb623 (diff)
downloaddexon-solidity-a1f61684b0bf687d15eb95d9d235876cdfa3c6e2.tar.gz
dexon-solidity-a1f61684b0bf687d15eb95d9d235876cdfa3c6e2.tar.zst
dexon-solidity-a1f61684b0bf687d15eb95d9d235876cdfa3c6e2.zip
Check that constructor does not have "returns" directive.
-rw-r--r--solidityNameAndTypeResolution.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/solidityNameAndTypeResolution.cpp b/solidityNameAndTypeResolution.cpp
index 03eaebb3..0ea6e51b 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()
}