mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
support decayed tuple expression as left value
This commit is contained in:
parent
6b711d0527
commit
568da11369
@ -792,6 +792,9 @@ bool TypeChecker::visit(TupleExpression const& _tuple)
|
||||
}
|
||||
else
|
||||
types.push_back(TypePointer());
|
||||
if (components.size() == 1)
|
||||
_tuple.annotation().type = type(*components[0]);
|
||||
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;
|
||||
|
@ -233,7 +233,12 @@ bool ExpressionCompiler::visit(TupleExpression const& _tuple)
|
||||
else if (_tuple.annotation().lValueRequested)
|
||||
lvalues.push_back(unique_ptr<LValue>());
|
||||
if (_tuple.annotation().lValueRequested)
|
||||
{
|
||||
if (_tuple.components().size() == 1)
|
||||
m_currentLValue = move(lvalues[0]);
|
||||
else
|
||||
m_currentLValue.reset(new TupleObject(m_context, move(lvalues)));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user