mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add structs to inheritable members
This commit is contained in:
parent
5e4665b84d
commit
47177542f5
7
AST.cpp
7
AST.cpp
@ -231,6 +231,13 @@ vector<ASTPointer<Declaration>> const& ContractDefinition::getInheritableMembers
|
||||
memberSeen.insert(v->getName());
|
||||
m_inheritableMembers->push_back(v);
|
||||
}
|
||||
|
||||
for (ASTPointer<StructDefinition> const& s: contract->getDefinedStructs())
|
||||
if (s->isPublic() && memberSeen.count(s->getName()) == 0)
|
||||
{
|
||||
memberSeen.insert(s->getName());
|
||||
m_inheritableMembers->push_back(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return *m_inheritableMembers;
|
||||
|
@ -1024,7 +1024,7 @@ 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.
|
||||
// members. Note that this does not add inherited functions on purpose.
|
||||
for (ASTPointer<Declaration> const& decl: contract.getInheritableMembers())
|
||||
members.push_back(make_pair(decl->getName(), decl->getType()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user