aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-08-04 21:16:23 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-08-04 22:22:22 +0800
commit83e6c345265c88c194416c2499af8afa3dc51e83 (patch)
tree1d62901acde7ee5d9f9db19ad3d16dcc3c41a67a /libsolidity/analysis
parent0b20e4fd22349da691056f3a4ac89c7c5006a0c4 (diff)
downloaddexon-solidity-83e6c345265c88c194416c2499af8afa3dc51e83.tar.gz
dexon-solidity-83e6c345265c88c194416c2499af8afa3dc51e83.tar.zst
dexon-solidity-83e6c345265c88c194416c2499af8afa3dc51e83.zip
Fix declaration suggestion for var with different number of components
Diffstat (limited to 'libsolidity/analysis')
-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 8c84e4dc..f742fcc0 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -1038,7 +1038,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();
@@ -1056,6 +1059,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 &&