mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9527 from a3d4/improve-error-coverage-zero-base
Use assert to check zero size base type
This commit is contained in:
commit
b5964a9328
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user