aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-02-06 19:08:24 +0800
committerchriseth <c@ethdev.com>2015-02-06 19:08:24 +0800
commit366284d37c555b2dfbbd8b8cf37a943660e5b69c (patch)
treec29bedc22e8a514a452a5a027e610df20ef282a6
parent3d98ea22663ef87cffc032f6bf921039e959c293 (diff)
parentbd41622341b7dd4acbe7dcbf56b77bbcd751bc2f (diff)
downloaddexon-solidity-366284d37c555b2dfbbd8b8cf37a943660e5b69c.tar.gz
dexon-solidity-366284d37c555b2dfbbd8b8cf37a943660e5b69c.tar.zst
dexon-solidity-366284d37c555b2dfbbd8b8cf37a943660e5b69c.zip
Merge pull request #963 from guanqun/disallow-void-var
Disallow implicit declaration of void type.
-rw-r--r--SolidityNameAndTypeResolution.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/SolidityNameAndTypeResolution.cpp b/SolidityNameAndTypeResolution.cpp
index ae6c374b..742d2ee2 100644
--- a/SolidityNameAndTypeResolution.cpp
+++ b/SolidityNameAndTypeResolution.cpp
@@ -904,6 +904,12 @@ BOOST_AUTO_TEST_CASE(invalid_parameter_names_in_named_args)
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
}
+BOOST_AUTO_TEST_CASE(disallow_declaration_of_void_type)
+{
+ char const* sourceCode = "contract c { function f() { var x = f(); } }";
+ BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
+}
+
BOOST_AUTO_TEST_SUITE_END()
}