diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-07-12 01:08:11 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-19 09:20:30 +0800 |
commit | 10677125ae5b2c211d22add52022ebd5a7cc8260 (patch) | |
tree | 4d281f0c7635f9805255457a22d0790d66970015 /libsolidity | |
parent | 7454a766b37951674095afdd0c8573713e2511a4 (diff) | |
download | dexon-solidity-10677125ae5b2c211d22add52022ebd5a7cc8260.tar.gz dexon-solidity-10677125ae5b2c211d22add52022ebd5a7cc8260.tar.zst dexon-solidity-10677125ae5b2c211d22add52022ebd5a7cc8260.zip |
Turn usage of callcode into an error as experimental 0.5.0 feature
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/analysis/StaticAnalyzer.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp index ffa538b6..bd8ee597 100644 --- a/libsolidity/analysis/StaticAnalyzer.cpp +++ b/libsolidity/analysis/StaticAnalyzer.cpp @@ -150,10 +150,18 @@ bool StaticAnalyzer::visit(MemberAccess const& _memberAccess) if (_memberAccess.memberName() == "callcode") if (auto const* type = dynamic_cast<FunctionType const*>(_memberAccess.annotation().type.get())) if (type->kind() == FunctionType::Kind::BareCallCode) - m_errorReporter.warning( - _memberAccess.location(), - "\"callcode\" has been deprecated in favour of \"delegatecall\"." - ); + { + if (m_currentContract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050)) + m_errorReporter.typeError( + _memberAccess.location(), + "\"callcode\" has been deprecated in favour of \"delegatecall\"." + ); + else + m_errorReporter.warning( + _memberAccess.location(), + "\"callcode\" has been deprecated in favour of \"delegatecall\"." + ); + } if (m_constructor && m_currentContract) if (ContractType const* type = dynamic_cast<ContractType const*>(_memberAccess.expression().annotation().type.get())) |