Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add members of address to contracts in experimental 0.5.0 #2981

Merged
merged 1 commit into from
Oct 5, 2017

Conversation

axic
Copy link
Member

@axic axic commented Sep 27, 2017

Fixes #2683. Depends on #2936.

@axic axic changed the title [WIPDo not add members of address to contracts in experimental 0.5.0 [WIP] Do not add members of address to contracts in experimental 0.5.0 Sep 27, 2017
@axic
Copy link
Member Author

axic commented Sep 27, 2017

Needs tests, but this must be the simplest 0.5.0 change :)

@axic axic force-pushed the no-address-overload branch from 5830277 to 34ba0d0 Compare September 29, 2017 15:40
@axic axic requested a review from chriseth September 29, 2017 15:40
@axic axic changed the title [WIP] Do not add members of address to contracts in experimental 0.5.0 Do not add members of address to contracts in experimental 0.5.0 Sep 29, 2017
@axic axic force-pushed the no-address-overload branch from 34ba0d0 to f734305 Compare October 2, 2017 20:44
@axic
Copy link
Member Author

axic commented Oct 2, 2017

@chriseth this is ready

@@ -1660,7 +1660,9 @@ MemberList::MemberMap ContractType::nativeMembers(ContractDefinition const*) con
&it.second->declaration()
));
}
addNonConflictingAddressMembers(members);
// In 0.5.0 address members are not populated into the contract.
if (!_contract->sourceUnit().annotation().experimentalFeatures.count(ExperimentalFeature::V050))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we assert for _contract != nullptr or turn on 0.5.0 only if it was supplied?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_contract is different from m_contract. The parameter only specifies the current scope, while m_contract is the actual x part in x.member.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, didn't notice the type has m_contract.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently m_contract doesn't behave correctly in this scenario for some reason.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I'm sorry. Of course it has to be the source unit where it is used in, not where it was defined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You initial comment was 100% correct.

docs/types.rst Outdated
@@ -107,6 +107,9 @@ Operators:

* ``<=``, ``<``, ``==``, ``!=``, ``>=`` and ``>``

.. note::
Starting with version 0.5.0 contracts do not derive from the address type.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but are still convertible to address.

@axic axic force-pushed the no-address-overload branch 2 times, most recently from 12c6edb to 5257f5e Compare October 4, 2017 10:01
@axic
Copy link
Member Author

axic commented Oct 4, 2017

@chriseth updated, ready to merge

@axic axic force-pushed the no-address-overload branch 2 times, most recently from 5f4a3f8 to 90b48ec Compare October 5, 2017 10:20
@axic axic force-pushed the no-address-overload branch from 90b48ec to 09276cb Compare October 5, 2017 10:42
@axic
Copy link
Member Author

axic commented Oct 5, 2017

@chriseth passes tests now

@chriseth
Copy link
Contributor

chriseth commented Oct 5, 2017

I hope we don't hit the assert...

@chriseth chriseth merged commit d0fa56a into develop Oct 5, 2017
@axic axic deleted the no-address-overload branch October 5, 2017 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants