aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-01 22:42:53 +0800
committerchriseth <c@ethdev.com>2017-03-02 21:33:58 +0800
commitcc01d870ff642ee3c52f5473f6f2a2fba5ec15c8 (patch)
treee421bd6cb31460a9f3ceadaf9f863620ecb7e893 /libsolidity/analysis
parent2600fa041319b285f43ac0c751756d422a4e2658 (diff)
downloaddexon-solidity-cc01d870ff642ee3c52f5473f6f2a2fba5ec15c8.tar.gz
dexon-solidity-cc01d870ff642ee3c52f5473f6f2a2fba5ec15c8.tar.zst
dexon-solidity-cc01d870ff642ee3c52f5473f6f2a2fba5ec15c8.zip
Disallow variable declaration with inferred empty tuple type.
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp5
1 files changed, 5 insertions, 0 deletions
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