Treats inline array as an error.

This commit is contained in:
Erik Kundt 2018-04-23 17:11:41 +02:00
parent b2ff9bc88d
commit 896018c8a3
2 changed files with 3 additions and 3 deletions

View File

@ -1423,6 +1423,8 @@ bool TypeChecker::visit(TupleExpression const& _tuple)
if (types[i]->category() == Type::Category::Tuple)
if (dynamic_cast<TupleType const&>(*types[i]).components().empty())
{
if (_tuple.isInlineArray())
m_errorReporter.fatalTypeError(components[i]->location(), "Array component cannot be empty.");
if (v050)
m_errorReporter.fatalTypeError(components[i]->location(), "Tuple component cannot be empty.");
else

View File

@ -8,6 +8,4 @@ contract C {
}
}
// ----
// Warning: (146-149): Tuple component cannot be empty.
// Warning: (151-154): Tuple component cannot be empty.
// TypeError: (145-155): Type tuple()[2] memory is not implicitly convertible to expected type tuple(uint256,uint256).
// TypeError: (146-149): Array component cannot be empty.