aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-10-19 17:10:10 +0800
committerGitHub <noreply@github.com>2017-10-19 17:10:10 +0800
commit0ae4aad8f346e3c23873aa97a359239714f3c039 (patch)
tree1c6b43116bf9b01cd561bf01d5d62b18224ed152 /libsolidity
parentda298eb5ad4ccc4a5a9f7efe3eb4295d2b020b3b (diff)
parent10677125ae5b2c211d22add52022ebd5a7cc8260 (diff)
downloaddexon-solidity-0ae4aad8f346e3c23873aa97a359239714f3c039.tar.gz
dexon-solidity-0ae4aad8f346e3c23873aa97a359239714f3c039.tar.zst
dexon-solidity-0ae4aad8f346e3c23873aa97a359239714f3c039.zip
Merge pull request #3108 from ethereum/remove-callcode
Turn usage of callcode into an error as experimental 0.5.0 feature
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/StaticAnalyzer.cpp16
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()))