diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-20 08:55:50 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-04-21 00:40:48 +0800 |
commit | 0493e3b0534ae165a9de934c327997dc58621256 (patch) | |
tree | a0c89bb75318baf17f12816cd0f7ba3870acff57 /libsolidity/analysis | |
parent | edd20ebefb7c08c9e0a98e9ec0ff5b4edc0b9b0e (diff) | |
download | dexon-solidity-0493e3b0534ae165a9de934c327997dc58621256.tar.gz dexon-solidity-0493e3b0534ae165a9de934c327997dc58621256.tar.zst dexon-solidity-0493e3b0534ae165a9de934c327997dc58621256.zip |
Turn deprecated warnings for sha3/suicide into errors (experimental 0.5.0)
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 66b0af58..40162322 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1652,10 +1652,18 @@ 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) - m_errorReporter.warning(_functionCall.location(), "\"sha3\" has been deprecated in favour of \"keccak256\""); + msg = "\"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\""); + 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); + } } if (!m_insideEmitStatement && functionType->kind() == FunctionType::Kind::Event) { |