aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST.cpp')
-rw-r--r--AST.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/AST.cpp b/AST.cpp
index bc6be600..82d58d2a 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -271,6 +271,20 @@ void ModifierInvocation::checkTypeRequirements()
BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in modifier invocation."));
}
+void EventDefinition::checkTypeRequirements()
+{
+ int numIndexed = 0;
+ for (ASTPointer<VariableDeclaration> const& var: getParameters())
+ {
+ if (var->isIndexed())
+ numIndexed++;
+ if (!var->getType()->canLiveOutsideStorage())
+ BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage."));
+ }
+ if (numIndexed > 3)
+ BOOST_THROW_EXCEPTION(createTypeError("More than 3 indexed arguments for event."));
+}
+
void Block::checkTypeRequirements()
{
for (shared_ptr<Statement> const& statement: m_statements)