From c8e4e9c05c9074152063d2176c25a851b537d571 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Tue, 15 Dec 2015 16:44:11 -0600 Subject: still not able to get types resolved, however it is compiling --- libsolidity/analysis/TypeChecker.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libsolidity/analysis') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 01de5eb0..2d6b6151 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -779,6 +779,7 @@ bool TypeChecker::visit(Assignment const& _assignment) bool TypeChecker::visit(TupleExpression const& _tuple) { + vector> const& components = _tuple.components(); TypePointers types; if (_tuple.annotation().lValueRequested) @@ -791,7 +792,10 @@ bool TypeChecker::visit(TupleExpression const& _tuple) } else types.push_back(TypePointer()); - _tuple.annotation().type = make_shared(types); + if (_tuple.isInlineArray()) + _tuple.annotation().type = make_shared(DataLocation::Storage, _tuple.annotation().type, types.size()); + else + _tuple.annotation().type = make_shared(types); // If some of the components are not LValues, the error is reported above. _tuple.annotation().isLValue = true; } @@ -801,7 +805,10 @@ bool TypeChecker::visit(TupleExpression const& _tuple) { // Outside of an lvalue-context, the only situation where a component can be empty is (x,). if (!components[i] && !(i == 1 && components.size() == 2)) - fatalTypeError(_tuple.location(), "Tuple component cannot be empty."); + _tuple.isInlineArray() ? + fatalTypeError(_tuple.location(), "Array component cannot have empty cells.") + : + fatalTypeError(_tuple.location(), "Tuple component cannot be empty."); else if (components[i]) { components[i]->accept(*this); -- cgit