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

Issue 7517 - Interface contracts broken #4794

Merged
merged 1 commit into from Feb 24, 2016
Merged

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Jul 1, 2015

@9rnsr
Copy link
Contributor Author

9rnsr commented Aug 30, 2015

This is not affected by the conversion to ddmd.

static C self;

void setEnable()
in {} // supply in-contract to invoke I.setEnable.in
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

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.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
7517 Interface contracts broken

@@ -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)
{
Copy link
Member

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?

@MartinNowak MartinNowak self-assigned this Feb 23, 2016
@MartinNowak
Copy link
Member

Auto-merge toggled on

@MartinNowak
Copy link
Member

thx

MartinNowak added a commit that referenced this pull request Feb 24, 2016
Issue 7517 - Interface contracts broken
@MartinNowak MartinNowak merged commit 65e058f into dlang:master Feb 24, 2016
@9rnsr 9rnsr deleted the fix7517 branch February 24, 2016 08: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
5 participants