diff options
author | LianaHus <liana@ethdev.com> | 2015-09-11 21:24:11 +0800 |
---|---|---|
committer | LianaHus <liana@ethdev.com> | 2015-09-11 21:24:11 +0800 |
commit | 1d1386a58cdeada9497a3940ab9a7d5c68f21af8 (patch) | |
tree | dc2c460864d637f0afe49a1a36a13da27d13b165 /libsolidity | |
parent | f5fc119dc80e6eb83bd145121ad13869ba246d76 (diff) | |
download | dexon-solidity-1d1386a58cdeada9497a3940ab9a7d5c68f21af8.tar.gz dexon-solidity-1d1386a58cdeada9497a3940ab9a7d5c68f21af8.tar.zst dexon-solidity-1d1386a58cdeada9497a3940ab9a7d5c68f21af8.zip |
add call for EventDefinition::checkTypeRequirements()
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/AST.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 25d2ccd8..1ac78dd1 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -85,6 +85,9 @@ void ContractDefinition::checkTypeRequirements() for (ASTPointer<VariableDeclaration> const& variable: m_stateVariables) variable->checkTypeRequirements(); + for (ASTPointer<EventDefinition> const& event: events()) + event->checkTypeRequirements(); + for (ASTPointer<ModifierDefinition> const& modifier: functionModifiers()) modifier->checkTypeRequirements(); @@ -699,13 +702,13 @@ void EventDefinition::checkTypeRequirements() { if (var->isIndexed()) numIndexed++; + if (numIndexed > 3) + BOOST_THROW_EXCEPTION(createTypeError("More than 3 indexed arguments for event.")); if (!var->type()->canLiveOutsideStorage()) BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage.")); if (!var->type()->externalType()) BOOST_THROW_EXCEPTION(var->createTypeError("Internal type is not allowed as event parameter type.")); } - if (numIndexed > 3) - BOOST_THROW_EXCEPTION(createTypeError("More than 3 indexed arguments for event.")); } void Block::checkTypeRequirements() |