diff options
author | chriseth <c@ethdev.com> | 2015-03-02 19:59:12 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-03-02 19:59:12 +0800 |
commit | 32e210eccad6ea951feaa3441a6aefb9938f8a90 (patch) | |
tree | 372ced6ce92be6a7a9d52bfc8ba2dfb371fbac23 /Types.cpp | |
parent | 346d87cc6347b8f6bd309b8f0dfc4a446adc7973 (diff) | |
parent | 4f13859f8c010410b7497ed860c409a8b899538c (diff) | |
download | dexon-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.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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) { |