Introduce emit statement.

This commit is contained in:
chriseth committed 2018-02-22 15:17:30 +01:00
1 parent 8fc9535d43
commit 388718b59f
17 files changed
+252 -3

No files matched your search

+9
View File
@@ -955,6 +955,15 @@ void TypeChecker::endVisit(Return const& _return)
}
}
void TypeChecker::endVisit(EmitStatement const& _emit)
{
if (
_emit.eventCall().annotation().kind != FunctionCallKind::FunctionCall ||
dynamic_cast<FunctionType const&>(*type(_emit.eventCall().expression())).kind() != FunctionType::Kind::Event
)
m_errorReporter.typeError(_emit.eventCall().expression().location(), "Expression has to be an event.");
}
bool TypeChecker::visit(VariableDeclarationStatement const& _statement)
{
if (!_statement.initialValue())