mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Validate each tuple literal
This commit is contained in:
committed by
chriseth
parent
c67b559ead
commit
c99d2aae04
@@ -1293,6 +1293,12 @@ bool TypeChecker::visit(TupleExpression const& _tuple)
|
||||
{
|
||||
components[i]->accept(*this);
|
||||
types.push_back(type(*components[i]));
|
||||
|
||||
// Note: code generation will visit each of the expression even if they are not assigned from.
|
||||
if (types[i]->category() == Type::Category::RationalNumber)
|
||||
if (!dynamic_cast<RationalNumberType const&>(*types[i]).mobileType())
|
||||
m_errorReporter.fatalTypeError(components[i]->location(), "Invalid rational number.");
|
||||
|
||||
if (_tuple.isInlineArray())
|
||||
solAssert(!!types[i], "Inline array cannot have empty components");
|
||||
if (_tuple.isInlineArray())
|
||||
|
||||
Reference in New Issue
Block a user