mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow compound assignment for tuples.
This commit is contained in:
parent
276229cc58
commit
93ef7fd260
@ -947,6 +947,11 @@ bool TypeChecker::visit(Assignment const& _assignment)
|
||||
_assignment.annotation().type = t;
|
||||
if (TupleType const* tupleType = dynamic_cast<TupleType const*>(t.get()))
|
||||
{
|
||||
if (_assignment.assignmentOperator() != Token::Assign)
|
||||
typeError(
|
||||
_assignment.location(),
|
||||
"Compound assignment is not allowed for tuple types."
|
||||
);
|
||||
// Sequenced assignments of tuples is not valid, make the result a "void" type.
|
||||
_assignment.annotation().type = make_shared<TupleType>();
|
||||
expectType(_assignment.rightHandSide(), *tupleType);
|
||||
|
Loading…
Reference in New Issue
Block a user