aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2015-12-16 06:44:11 +0800
committerRJ Catalano <catalanor0220@gmail.com>2015-12-16 06:44:11 +0800
commitc8e4e9c05c9074152063d2176c25a851b537d571 (patch)
tree5d60bf9fd643764c08f497f9bd69be963377a222 /libsolidity
parent9ab066de8c157726b9976588b4907496c3489f42 (diff)
downloaddexon-solidity-c8e4e9c05c9074152063d2176c25a851b537d571.tar.gz
dexon-solidity-c8e4e9c05c9074152063d2176c25a851b537d571.tar.zst
dexon-solidity-c8e4e9c05c9074152063d2176c25a851b537d571.zip
still not able to get types resolved, however it is compiling
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp11
1 files changed, 9 insertions, 2 deletions
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<ASTPointer<Expression>> 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<TupleType>(types);
+ if (_tuple.isInlineArray())
+ _tuple.annotation().type = make_shared<ArrayType>(DataLocation::Storage, _tuple.annotation().type, types.size());
+ else
+ _tuple.annotation().type = make_shared<TupleType>(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);