From cc01d870ff642ee3c52f5473f6f2a2fba5ec15c8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 1 Mar 2017 15:42:53 +0100 Subject: Disallow variable declaration with inferred empty tuple type. --- libsolidity/analysis/TypeChecker.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libsolidity') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 4025831e..ff55ef1f 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -824,6 +824,11 @@ bool TypeChecker::visit(VariableDeclarationStatement const& _statement) else solAssert(false, ""); } + else if (*var.annotation().type == TupleType()) + typeError( + var.location(), + "Cannot declare variable with void (empty tuple) type." + ); var.accept(*this); } else -- cgit v1.2.3