Use assert to check zero size base type

This commit is contained in:
a3d4 2020-07-27 20:31:51 +02:00
parent 8a6aa53791
commit 5394435bea

View File

@ -243,12 +243,7 @@ void DeclarationTypeChecker::endVisit(ArrayTypeName const& _typeName)
solAssert(!m_errorReporter.errors().empty(), ""); solAssert(!m_errorReporter.errors().empty(), "");
return; return;
} }
if (baseType->storageBytes() == 0) solAssert(baseType->storageBytes() != 0, "Illegal base type of storage size zero for array.");
m_errorReporter.fatalTypeError(
6493_error,
_typeName.baseType().location(),
"Illegal base type of storage size zero for array."
);
if (Expression const* length = _typeName.length()) if (Expression const* length = _typeName.length())
{ {
TypePointer& lengthTypeGeneric = length->annotation().type; TypePointer& lengthTypeGeneric = length->annotation().type;