aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-26 19:11:54 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-03-02 18:51:13 +0800
commit47177542f54a29562d99b27554ed991f318c058a (patch)
treebec1cf6fb0c40f834f13e46463551bb53fae0a6e
parent5e4665b84deda7943edf1fab0ab32c48c4629fac (diff)
downloaddexon-solidity-47177542f54a29562d99b27554ed991f318c058a.tar
dexon-solidity-47177542f54a29562d99b27554ed991f318c058a.tar.gz
dexon-solidity-47177542f54a29562d99b27554ed991f318c058a.tar.bz2
dexon-solidity-47177542f54a29562d99b27554ed991f318c058a.tar.lz
dexon-solidity-47177542f54a29562d99b27554ed991f318c058a.tar.xz
dexon-solidity-47177542f54a29562d99b27554ed991f318c058a.tar.zst
dexon-solidity-47177542f54a29562d99b27554ed991f318c058a.zip
Add structs to inheritable members
-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()));
}