mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Moved storage size assert to TypeChecker from DeclarationTypeChecker
This commit is contained in:
@@ -289,7 +289,6 @@ void DeclarationTypeChecker::endVisit(ArrayTypeName const& _typeName)
|
||||
return;
|
||||
}
|
||||
|
||||
solAssert(baseType->storageBytes() != 0, "Illegal base type of storage size zero for array.");
|
||||
if (Expression const* length = _typeName.length())
|
||||
{
|
||||
optional<rational> lengthValue;
|
||||
|
||||
@@ -1220,6 +1220,14 @@ void TypeChecker::endVisit(RevertStatement const& _revert)
|
||||
m_errorReporter.typeError(1885_error, errorCall.expression().location(), "Expression has to be an error.");
|
||||
}
|
||||
|
||||
void TypeChecker::endVisit(ArrayTypeName const& _typeName)
|
||||
{
|
||||
solAssert(
|
||||
_typeName.baseType().annotation().type &&
|
||||
_typeName.baseType().annotation().type->storageBytes() != 0,
|
||||
"Illegal base type of storage size zero for array."
|
||||
);
|
||||
}
|
||||
|
||||
bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
|
||||
{
|
||||
|
||||
@@ -119,6 +119,7 @@ private:
|
||||
void endVisit(InheritanceSpecifier const& _inheritance) override;
|
||||
void endVisit(ModifierDefinition const& _modifier) override;
|
||||
bool visit(FunctionDefinition const& _function) override;
|
||||
void endVisit(ArrayTypeName const& _typeName) override;
|
||||
bool visit(VariableDeclaration const& _variable) override;
|
||||
/// We need to do this manually because we want to pass the bases of the current contract in
|
||||
/// case this is a base constructor call.
|
||||
|
||||
Reference in New Issue
Block a user