aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/analysis/TypeChecker.cpp2
-rw-r--r--test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol4
2 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp
index 53409e6c..02f2f833 100644
--- a/libsolidity/analysis/TypeChecker.cpp
+++ b/libsolidity/analysis/TypeChecker.cpp
@@ -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
diff --git a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol
index 8d77df47..f8b2ae7e 100644
--- a/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol
+++ b/test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol
@@ -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.