diff options
author | chriseth <chris@ethereum.org> | 2018-03-14 00:18:21 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-03-14 00:18:46 +0800 |
commit | eecc26deec1815191bc3405e54ef84daaba853a1 (patch) | |
tree | fee544ac1ab5b49de54366f81ef1f8beb9727dde /libsolidity/ast | |
parent | 8ad0fb3be3998cf509c6329f41428fcd8d0d7de5 (diff) | |
download | dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.gz dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.tar.zst dexon-solidity-eecc26deec1815191bc3405e54ef84daaba853a1.zip |
Make external library functions accessible.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/AST.h | 1 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 863ad2fe..a25df64b 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -203,6 +203,7 @@ public: bool isPublic() const { return visibility() >= Visibility::Public; } virtual bool isVisibleInContract() const { return visibility() != Visibility::External; } bool isVisibleInDerivedContracts() const { return isVisibleInContract() && visibility() >= Visibility::Internal; } + bool isVisibleAsLibraryMember() const { return visibility() >= Visibility::Internal; } std::string fullyQualifiedName() const { return sourceUnitName() + ":" + name(); } diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index c08e0e67..b2881bea 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -304,7 +304,7 @@ MemberList::MemberMap Type::boundFunctions(Type const& _type, ContractDefinition ); for (FunctionDefinition const* function: library.definedFunctions()) { - if (!function->isVisibleInDerivedContracts() || seenFunctions.count(function)) + if (!function->isVisibleAsLibraryMember() || seenFunctions.count(function)) continue; seenFunctions.insert(function); FunctionType funType(*function, false); @@ -2875,7 +2875,7 @@ MemberList::MemberMap TypeType::nativeMembers(ContractDefinition const* _current } if (contract.isLibrary()) for (FunctionDefinition const* function: contract.definedFunctions()) - if (function->isVisibleInDerivedContracts()) + if (function->isVisibleAsLibraryMember()) members.push_back(MemberList::Member( function->name(), FunctionType(*function).asMemberFunction(true), |