aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-02-14 07:43:02 +0800
committerChristian <c@ethdev.com>2015-02-17 02:24:07 +0800
commit3e29ec2cb2075fc6734a0f350503c393fbeeb3d6 (patch)
tree21012d2ea633c1473d057daea4f3b4ff7e60a574 /Types.cpp
parent500cb69f12a1e048258b1ebb9fa5ea858433ffff (diff)
downloaddexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.gz
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.bz2
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.lz
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.xz
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.tar.zst
dexon-solidity-3e29ec2cb2075fc6734a0f350503c393fbeeb3d6.zip
"external" visibility specifier.
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Types.cpp b/Types.cpp
index 5d753645..99515a3a 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -572,7 +572,8 @@ MemberList const& ContractType::getMembers() const
{
for (ContractDefinition const* base: m_contract.getLinearizedBaseContracts())
for (ASTPointer<FunctionDefinition> const& function: base->getDefinedFunctions())
- if (!function->isConstructor() && !function->getName().empty())
+ if (!function->isConstructor() && !function->getName().empty() &&
+ function->isVisibleInDerivedContracts())
members.insert(make_pair(function->getName(), make_shared<FunctionType>(*function, true)));
}
else
@@ -957,10 +958,10 @@ MemberList const& TypeType::getMembers() const
ContractDefinition const& contract = dynamic_cast<ContractType const&>(*m_actualType).getContractDefinition();
vector<ContractDefinition const*> currentBases = m_currentContract->getLinearizedBaseContracts();
if (find(currentBases.begin(), currentBases.end(), &contract) != currentBases.end())
- // We are accessing the type of a base contract, so add all public and private
+ // We are accessing the type of a base contract, so add all public and protected
// functions. Note that this does not add inherited functions on purpose.
for (ASTPointer<FunctionDefinition> const& f: contract.getDefinedFunctions())
- if (!f->isConstructor() && !f->getName().empty())
+ if (!f->isConstructor() && !f->getName().empty() && f->isVisibleInDerivedContracts())
members[f->getName()] = make_shared<FunctionType>(*f);
}
else if (m_actualType->getCategory() == Category::Enum)