Skip to content

Commit

Permalink
Do not add members of address t ocontracts in experimental 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Sep 27, 2017
1 parent e1eaf4e commit 5830277
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Features:
* Parser: Better error message for unexpected trailing comma in parameter lists.
* Type Checker: Do not add members of ``address`` to contracts as experimetnal 0.5.0 feature.

Bugfixes:
* Type Checker: Properly support overwriting members inherited from ``address`` in a contract
Expand Down
5 changes: 4 additions & 1 deletion libsolidity/ast/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ string ContractType::canonicalName() const
return m_contract.annotation().canonicalName;
}

MemberList::MemberMap ContractType::nativeMembers(ContractDefinition const*) const
MemberList::MemberMap ContractType::nativeMembers(ContractDefinition const* _contract) const
{
// All address members and all interface functions
MemberList::MemberMap addressMembers = IntegerType(160, IntegerType::Modifier::Address).nativeMembers(nullptr);
Expand Down Expand Up @@ -1662,6 +1662,9 @@ MemberList::MemberMap ContractType::nativeMembers(ContractDefinition const*) con
&it.second->declaration()
));
}
// In 0.5.0 address members are not populated into the contract.
if (_contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050))
return members;
// Add overloads from address only if there is no conflict
for (auto it = addressMembers.begin(); it != addressMembers.end(); ++it)
{
Expand Down

0 comments on commit 5830277

Please sign in to comment.