aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-01 22:42:41 +0800
committerchriseth <c@ethdev.com>2017-03-02 21:33:58 +0800
commit2600fa041319b285f43ac0c751756d422a4e2658 (patch)
tree3cb8058ed3ce7cf5ea9d9dd1645597a2d75bc287
parent5c411b472b5830efa798309e1e7ed728acafdfa3 (diff)
downloaddexon-solidity-2600fa041319b285f43ac0c751756d422a4e2658.tar.gz
dexon-solidity-2600fa041319b285f43ac0c751756d422a4e2658.tar.zst
dexon-solidity-2600fa041319b285f43ac0c751756d422a4e2658.zip
Test for declaring variable with empty tuple type.
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 866bd9aa..3b137572 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -2950,6 +2950,19 @@ BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_6)
CHECK_ERROR(text, TypeError, "");
}
+BOOST_AUTO_TEST_CASE(tuple_assignment_from_void_function)
+{
+ char const* text = R"(
+ contract C {
+ function f() { }
+ function g() {
+ var (x,) = (f(), f());
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "Cannot declare variable with void (empty tuple) type.");
+}
+
BOOST_AUTO_TEST_CASE(member_access_parser_ambiguity)
{
char const* text = R"(