From ffe7f224a6c9598284f100f842e3cfba58974d56 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Fri, 4 May 2018 05:21:28 +0100 Subject: Show proper error when trying to emit a non-event --- libsolidity/analysis/TypeChecker.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libsolidity') diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 7ea10c5b..fe907a2d 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1067,6 +1067,7 @@ void TypeChecker::endVisit(EmitStatement const& _emit) { if ( _emit.eventCall().annotation().kind != FunctionCallKind::FunctionCall || + type(_emit.eventCall().expression())->category() != Type::Category::Function || dynamic_cast(*type(_emit.eventCall().expression())).kind() != FunctionType::Kind::Event ) m_errorReporter.typeError(_emit.eventCall().expression().location(), "Expression has to be an event invocation."); -- cgit v1.2.3