Warn about obsolete sha3/suicide calls

This commit is contained in:
Alex Beregszaszi
2017-09-19 11:11:19 +01:00
parent 1fc71bd758
commit ed1fd49ab0
3 changed files with 38 additions and 3 deletions
+8
View File
@@ -1477,6 +1477,14 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
else
_functionCall.annotation().type = make_shared<TupleType>(functionType->returnParameterTypes());
if (auto functionName = dynamic_cast<Identifier const*>(&_functionCall.expression()))
{
if (functionName->name() == "sha3" && functionType->kind() == FunctionType::Kind::SHA3)
m_errorReporter.warning(_functionCall.location(), "\"sha3\" has been deprecated in favour of \"keccak256\"");
else if (functionName->name() == "suicide" && functionType->kind() == FunctionType::Kind::Selfdestruct)
m_errorReporter.warning(_functionCall.location(), "\"suicide\" has been deprecated in favour of \"selfdestruct\"");
}
TypePointers parameterTypes = functionType->parameterTypes();
if (!functionType->padArguments())