aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AST.cpp7
-rw-r--r--Types.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/AST.cpp b/AST.cpp
index b61eb011..8c1944f9 100644
--- a/AST.cpp
+++ b/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;
diff --git a/Types.cpp b/Types.cpp
index 1347c9ea..73367c85 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -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()));
}