-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Conversation
Needs tests, but this must be the simplest 0.5.0 change :) |
5830277
to
34ba0d0
Compare
34ba0d0
to
f734305
Compare
@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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
12c6edb
to
5257f5e
Compare
@chriseth updated, ready to merge |
5f4a3f8
to
90b48ec
Compare
90b48ec
to
09276cb
Compare
@chriseth passes tests now |
I hope we don't hit the assert... |
Fixes #2683. Depends on #2936.