aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-08-06 17:21:54 +0800
committerGitHub <noreply@github.com>2018-08-06 17:21:54 +0800
commit30f981fc2ca00765bdf6be55f1b634937847ab92 (patch)
tree84ad7279dad85b5517f6b64244ce38f1bb14fa8d /libsolidity
parent3684151e53ae4482c6b4dfea1debe5050c24d6c6 (diff)
parent83e6c345265c88c194416c2499af8afa3dc51e83 (diff)
downloaddexon-solidity-30f981fc2ca00765bdf6be55f1b634937847ab92.tar.gz
dexon-solidity-30f981fc2ca00765bdf6be55f1b634937847ab92.tar.zst
dexon-solidity-30f981fc2ca00765bdf6be55f1b634937847ab92.zip
Merge pull request #4681 from ethereum/var-suggestion-crash
Fix declaration suggestion for var with different number of components
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index e868d111..47df10b2 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1034,7 +1034,10 @@ string createTupleDecl(vector<ASTPointer<VariableDeclaration>> const& _decls)
vector<string> components;
for (ASTPointer<VariableDeclaration> const& decl: _decls)
if (decl)
+ {
+ solAssert(decl->annotation().type, "");
components.emplace_back(decl->annotation().type->toString(false) + " " + decl->name());
+ }
else
components.emplace_back();
@@ -1052,6 +1055,9 @@ bool typeCanBeExpressed(vector<ASTPointer<VariableDeclaration>> const& decls)
if (!decl)
continue;
+ if (!decl->annotation().type)
+ return false;
+
if (auto functionType = dynamic_cast<FunctionType const*>(decl->annotation().type.get()))
if (
functionType->kind() != FunctionType::Kind::Internal &&