aboutsummaryrefslogtreecommitdiffstats
path: root/Types.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-02 19:59:12 +0800
committerchriseth <c@ethdev.com>2015-03-02 19:59:12 +0800
commit32e210eccad6ea951feaa3441a6aefb9938f8a90 (patch)
tree372ced6ce92be6a7a9d52bfc8ba2dfb371fbac23 /Types.cpp
parent346d87cc6347b8f6bd309b8f0dfc4a446adc7973 (diff)
parent4f13859f8c010410b7497ed860c409a8b899538c (diff)
downloaddexon-solidity-32e210eccad6ea951feaa3441a6aefb9938f8a90.tar.gz
dexon-solidity-32e210eccad6ea951feaa3441a6aefb9938f8a90.tar.zst
dexon-solidity-32e210eccad6ea951feaa3441a6aefb9938f8a90.zip
Merge pull request #1146 from LefterisJP/sol_fixBaseClassAccessors
Sol fix accessing public variable of base class
Diffstat (limited to 'Types.cpp')
-rw-r--r--Types.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Types.cpp b/Types.cpp
index 8cc1f258..22d612cd 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -643,8 +643,7 @@ 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()&&
- function->isVisibleInDerivedContracts())
+ if (function->isVisibleInDerivedContracts())
members.push_back(make_pair(function->getName(), make_shared<FunctionType>(*function, true)));
}
else
@@ -1039,10 +1038,9 @@ MemberList const& TypeType::getMembers() const
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 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() && f->isVisibleInDerivedContracts())
- members.push_back(make_pair(f->getName(), make_shared<FunctionType>(*f)));
+ // members. Note that this does not add inherited functions on purpose.
+ for (Declaration const* decl: contract.getInheritableMembers())
+ members.push_back(make_pair(decl->getName(), decl->getType()));
}
else if (m_actualType->getCategory() == Category::Enum)
{