mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow sha3/suicide aliases
This commit is contained in:
@@ -1708,18 +1708,10 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
||||
|
||||
if (auto functionName = dynamic_cast<Identifier const*>(&_functionCall.expression()))
|
||||
{
|
||||
string msg;
|
||||
if (functionName->name() == "sha3" && functionType->kind() == FunctionType::Kind::SHA3)
|
||||
msg = "\"sha3\" has been deprecated in favour of \"keccak256\"";
|
||||
m_errorReporter.typeError(_functionCall.location(), "\"sha3\" has been deprecated in favour of \"keccak256\"");
|
||||
else if (functionName->name() == "suicide" && functionType->kind() == FunctionType::Kind::Selfdestruct)
|
||||
msg = "\"suicide\" has been deprecated in favour of \"selfdestruct\"";
|
||||
if (!msg.empty())
|
||||
{
|
||||
if (v050)
|
||||
m_errorReporter.typeError(_functionCall.location(), msg);
|
||||
else
|
||||
m_errorReporter.warning(_functionCall.location(), msg);
|
||||
}
|
||||
m_errorReporter.typeError(_functionCall.location(), "\"suicide\" has been deprecated in favour of \"selfdestruct\"");
|
||||
}
|
||||
if (!m_insideEmitStatement && functionType->kind() == FunctionType::Kind::Event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user