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
Issue 7517 - Interface contracts broken #4794
Conversation
817ca37
to
ff3766b
Compare
This is not affected by the conversion to ddmd. |
static C self; | ||
|
||
void setEnable() | ||
in {} // supply in-contract to invoke I.setEnable.in |
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.
This PR tries to make it so no in-contract would mean inherit from base and empty in-contract - relax the contract to not require anything, which I think is more logical.
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.
Huh, I completely forgot about it :-(. While I think it's more logical, and was a huge source of bugs for me (library methods are using contracts, and my code that was extending them was not, so none of the contracts were executed making me scratch the head when I saw that some arguments inside body are null, despite the in
contract), I'm not sure if this will actually be accepted, as it is a breaking change, and I got busy with another things, so I completely forgot about it. If there's an interest, I can make it before Christmas.
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.
@nemanja-boric-sociomantic since it's a breaking change, I think that we should start a forum discussion.
My hope is that since the behavior proposed by your PR is more intuitive, it will get supported by enough people to be accepted.
|
a05b8d7
to
e5cbcac
Compare
@@ -148,7 +148,33 @@ elem *getEthis(Loc loc, IRState *irs, Dsymbol *fd) | |||
* adding this frame into the linked list of stack | |||
* frames. | |||
*/ | |||
if (thisfd->hasNestedFrameRefs()) | |||
if (fdp != thisfd) | |||
{ |
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.
Can you please clarify the variable names fdparent
and fdp
?
Auto-merge toggled on |
thx |
Issue 7517 - Interface contracts broken
https://issues.dlang.org/show_bug.cgi?id=7517
Based on: #4789