diff options
author | chriseth <c@ethdev.com> | 2017-02-14 20:32:48 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-02-14 20:32:48 +0800 |
commit | a791ec75e2e73130afee391958651453acc8d781 (patch) | |
tree | bb82b5bedd911e3016d1be7d2cd35dbeeb156263 | |
parent | b1bb228ab3a8ca0548ed5f08fdc5fda1fcb71b1a (diff) | |
download | dexon-solidity-a791ec75e2e73130afee391958651453acc8d781.tar.gz dexon-solidity-a791ec75e2e73130afee391958651453acc8d781.tar.zst dexon-solidity-a791ec75e2e73130afee391958651453acc8d781.zip |
Review comments.
-rw-r--r-- | libsolidity/analysis/NameAndTypeResolver.cpp | 2 | ||||
-rw-r--r-- | libsolidity/analysis/NameAndTypeResolver.h | 5 | ||||
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 7 |
3 files changed, 7 insertions, 7 deletions
diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp index fd6fc058..01384260 100644 --- a/libsolidity/analysis/NameAndTypeResolver.cpp +++ b/libsolidity/analysis/NameAndTypeResolver.cpp @@ -139,7 +139,7 @@ bool NameAndTypeResolver::resolveNamesAndTypes(ASTNode& _node, bool _resolveInsi solAssert(!!m_currentScope, ""); for (ASTPointer<InheritanceSpecifier> const& baseContract: contract->baseContracts()) - if (!resolveNamesAndTypes(*baseContract, false)) + if (!resolveNamesAndTypes(*baseContract, true)) success = false; m_currentScope = m_scopes[contract].get(); diff --git a/libsolidity/analysis/NameAndTypeResolver.h b/libsolidity/analysis/NameAndTypeResolver.h index 4de40e87..828b566f 100644 --- a/libsolidity/analysis/NameAndTypeResolver.h +++ b/libsolidity/analysis/NameAndTypeResolver.h @@ -42,6 +42,9 @@ namespace solidity class NameAndTypeResolver: private boost::noncopyable { public: + /// Creates the resolver with the given declarations added to the global scope. + /// @param _scopes mapping of scopes to be used (usually default constructed), these + /// are filled during the lifetime of this object. NameAndTypeResolver( std::vector<Declaration const*> const& _globals, std::map<ASTNode const*, std::shared_ptr<DeclarationContainer>>& _scopes, @@ -57,7 +60,7 @@ public: /// Resolves all names and types referenced from the given AST Node. /// This is usually only called at the contract level, but with a bit of care, it can also /// be called at deeper levels. - /// @param _avoidCode if false, does not descend into nodes that contain code. + /// @param _resolveInsideCode if false, does not descend into nodes that contain code. /// @returns false in case of error. bool resolveNamesAndTypes(ASTNode& _node, bool _resolveInsideCode = true); /// Updates the given global declaration (used for "this"). Not to be used with declarations diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 06a9e1ce..28cb9acc 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -427,12 +427,9 @@ bool TypeChecker::visit(StructDefinition const& _struct) bool TypeChecker::visit(FunctionDefinition const& _function) { - bool isLibraryFunction = false; - if ( + bool isLibraryFunction = dynamic_cast<ContractDefinition const*>(_function.scope()) && - dynamic_cast<ContractDefinition const*>(_function.scope())->isLibrary() - ) - isLibraryFunction = true; + dynamic_cast<ContractDefinition const*>(_function.scope())->isLibrary(); if (_function.isPayable()) { if (isLibraryFunction) |