diff options
author | chriseth <chris@ethereum.org> | 2017-09-13 23:29:27 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-09-13 23:29:27 +0800 |
commit | e2f30ce9ca3bc8c6c6e64c074b98bafec7e2e5d5 (patch) | |
tree | d5f174f26a543472a1539bbef594e56dd05953b5 /libsolidity/analysis/ViewPureChecker.cpp | |
parent | 66c01301fe5cb71a2bf66af2f7170043f088815c (diff) | |
download | dexon-solidity-e2f30ce9ca3bc8c6c6e64c074b98bafec7e2e5d5.tar.gz dexon-solidity-e2f30ce9ca3bc8c6c6e64c074b98bafec7e2e5d5.tar.zst dexon-solidity-e2f30ce9ca3bc8c6c6e64c074b98bafec7e2e5d5.zip |
Minor changes from review.
Diffstat (limited to 'libsolidity/analysis/ViewPureChecker.cpp')
-rw-r--r-- | libsolidity/analysis/ViewPureChecker.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libsolidity/analysis/ViewPureChecker.cpp b/libsolidity/analysis/ViewPureChecker.cpp index 40ad6828..8f9d41c9 100644 --- a/libsolidity/analysis/ViewPureChecker.cpp +++ b/libsolidity/analysis/ViewPureChecker.cpp @@ -108,12 +108,7 @@ bool ViewPureChecker::check() { SourceUnit const* source = dynamic_cast<SourceUnit const*>(node.get()); solAssert(source, ""); - for (auto const& topLevelNode: source->nodes()) - { - ContractDefinition const* contract = dynamic_cast<ContractDefinition const*>(topLevelNode.get()); - if (contract) - contracts.push_back(contract); - } + contracts += source->filteredNodes<ContractDefinition>(source->nodes()); } // Check modifiers first to infer their state mutability. @@ -146,7 +141,6 @@ void ViewPureChecker::endVisit(FunctionDefinition const& _funDef) _funDef.isImplemented() && !_funDef.isConstructor() && !_funDef.isFallback() && - !_funDef.isConstructor() && !_funDef.annotation().superFunction ) m_errorReporter.warning( @@ -207,7 +201,7 @@ void ViewPureChecker::endVisit(Identifier const& _identifier) void ViewPureChecker::endVisit(InlineAssembly const& _inlineAssembly) { AssemblyViewPureChecker{ - [=](StateMutability _mut, SourceLocation const& _loc) { reportMutability(_mut, _loc); } + [=](StateMutability _mutability, SourceLocation const& _location) { reportMutability(_mutability, _location); } }(_inlineAssembly.operations()); } @@ -230,7 +224,7 @@ void ViewPureChecker::reportMutability(StateMutability _mutability, SourceLocati solAssert(false, ""); if (m_currentFunction->stateMutability() == StateMutability::View) - // Change this to error with 0.5.0 + // TODO Change this to error with 0.5.0 m_errorReporter.warning(_location, text); else if (m_currentFunction->stateMutability() == StateMutability::Pure) { |