add call for EventDefinition::checkTypeRequirements()

This commit is contained in:
LianaHus
2015-09-11 15:24:11 +02:00
parent f5fc119dc8
commit 1d1386a58c
3 changed files with 5 additions and 17 deletions
+5 -2
View File
@@ -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()