Move event-outside-emit check to PostTypeChecker

refs #7566
This commit is contained in:
Mathias Baumann
2020-01-08 14:05:08 +01:00
committed by chriseth
parent 9f8d49e358
commit 21844aa545
4 changed files with 60 additions and 12 deletions
-8
View File
@@ -981,7 +981,6 @@ void TypeChecker::endVisit(EmitStatement const& _emit)
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 invocation.");
m_insideEmitStatement = false;
}
namespace
@@ -1715,13 +1714,6 @@ void TypeChecker::typeCheckFunctionCall(
"\"staticcall\" is not supported by the VM version."
);
// Check for event outside of emit statement
if (!m_insideEmitStatement && _functionType->kind() == FunctionType::Kind::Event)
m_errorReporter.typeError(
_functionCall.location(),
"Event invocations have to be prefixed by \"emit\"."
);
// Perform standard function call type checking
typeCheckFunctionGeneralChecks(_functionCall, _functionType);
}