diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-27 18:40:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-27 18:40:06 +0800 |
commit | 32f08989dbacb7d839ebc916ac995ecc08eee6eb (patch) | |
tree | 89dfb9711bad71fc6dbdec2a4641ba7967d44dc4 /libsolidity/analysis/StaticAnalyzer.cpp | |
parent | ba209fe485ba40ea3926800bc90932bec40cd16f (diff) | |
parent | 2c56e530467c088c5096d95422313ca211786eca (diff) | |
download | dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.gz dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.bz2 dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.lz dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.xz dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.tar.zst dexon-solidity-32f08989dbacb7d839ebc916ac995ecc08eee6eb.zip |
Merge pull request #3646 from ethereum/blockhash-global
Move blockhash from block.blockhash to global level.
Diffstat (limited to 'libsolidity/analysis/StaticAnalyzer.cpp')
-rw-r--r-- | libsolidity/analysis/StaticAnalyzer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.cpp b/libsolidity/analysis/StaticAnalyzer.cpp index d4de219a..6aee260e 100644 --- a/libsolidity/analysis/StaticAnalyzer.cpp +++ b/libsolidity/analysis/StaticAnalyzer.cpp @@ -142,6 +142,7 @@ bool StaticAnalyzer::visit(MemberAccess const& _memberAccess) bool const v050 = m_currentContract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050); if (MagicType const* type = dynamic_cast<MagicType const*>(_memberAccess.expression().annotation().type.get())) + { if (type->kind() == MagicType::Kind::Message && _memberAccess.memberName() == "gas") { if (v050) @@ -155,6 +156,20 @@ bool StaticAnalyzer::visit(MemberAccess const& _memberAccess) "\"msg.gas\" has been deprecated in favor of \"gasleft()\"" ); } + if (type->kind() == MagicType::Kind::Block && _memberAccess.memberName() == "blockhash") + { + if (v050) + m_errorReporter.typeError( + _memberAccess.location(), + "\"block.blockhash()\" has been deprecated in favor of \"blockhash()\"" + ); + else + m_errorReporter.warning( + _memberAccess.location(), + "\"block.blockhash()\" has been deprecated in favor of \"blockhash()\"" + ); + } + } if (m_nonPayablePublic && !m_library) if (MagicType const* type = dynamic_cast<MagicType const*>(_memberAccess.expression().annotation().type.get())) |