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:
parent
453f404f8f
commit
9428dbc94f
@ -23,6 +23,8 @@ Bugfixes:
|
|||||||
* Commandline Interface: When linking only accept exact matches for library names passed to the ``--libraries`` option. Library names not prefixed with a file name used to match any library with that name.
|
* Commandline Interface: When linking only accept exact matches for library names passed to the ``--libraries`` option. Library names not prefixed with a file name used to match any library with that name.
|
||||||
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).
|
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).
|
||||||
* TypeChecker: Fix internal error when using user defined value types in public library functions.
|
* TypeChecker: Fix internal error when using user defined value types in public library functions.
|
||||||
|
* TypeChecker: Fix internal error when using arrays and structs with user defined value types before declaration.
|
||||||
|
* TypeChecker: Improved error message for constant variables with (nested) mapping types.
|
||||||
* Yul Assembler: Fix internal error when function names are not unique.
|
* Yul Assembler: Fix internal error when function names are not unique.
|
||||||
* Yul IR Generator: Do not output empty switches/if-bodies for empty contracts.
|
* Yul IR Generator: Do not output empty switches/if-bodies for empty contracts.
|
||||||
|
|
||||||
|
@ -289,7 +289,6 @@ void DeclarationTypeChecker::endVisit(ArrayTypeName const& _typeName)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
solAssert(baseType->storageBytes() != 0, "Illegal base type of storage size zero for array.");
|
|
||||||
if (Expression const* length = _typeName.length())
|
if (Expression const* length = _typeName.length())
|
||||||
{
|
{
|
||||||
optional<rational> lengthValue;
|
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.");
|
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)
|
bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
|
||||||
{
|
{
|
||||||
|
@ -119,6 +119,7 @@ private:
|
|||||||
void endVisit(InheritanceSpecifier const& _inheritance) override;
|
void endVisit(InheritanceSpecifier const& _inheritance) override;
|
||||||
void endVisit(ModifierDefinition const& _modifier) override;
|
void endVisit(ModifierDefinition const& _modifier) override;
|
||||||
bool visit(FunctionDefinition const& _function) override;
|
bool visit(FunctionDefinition const& _function) override;
|
||||||
|
void endVisit(ArrayTypeName const& _typeName) override;
|
||||||
bool visit(VariableDeclaration const& _variable) 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
|
/// 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.
|
/// case this is a base constructor call.
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
contract C {
|
||||||
|
Left[] pu1;
|
||||||
|
}
|
||||||
|
type Left is bytes2;
|
Loading…
Reference in New Issue
Block a user