-
-
Notifications
You must be signed in to change notification settings - Fork 668
fix Issue 519 - Invariant not called from autogenerated class/struct ctor/dtor #4136
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
Conversation
|
Documentation fix: dlang/dlang.org#699 |
5732e62 to
8174c5e
Compare
|
Phew! finally passing. |
src/class.c
Outdated
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.
Please don't add disabled code.
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.
I prefer to leave it in until the controversy is over.
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.
Do you mean leave it in the pull request or leave it in the compiler's source?
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.
yes and yes until the controversy is over.
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.
"Controversy is over" – where does the actual discussion take place? The last related reply in the bugzilla issue was in 2012.
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.
Part of my solution is to change the spec to say the invariant won't run for trivial construction. Since obviously several people expect it to, I await their response.
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.
Sounds like we should have that discussion before making the change.
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.
|
Sigh. I cannot reproduce these failures in std.datetime: Anyone know what is going on? |
|
Figured it out. Needs this phobos pull: |
|
Any idea why it worked before? |
|
I don't know how datetime works. It's got too many layers to it :-( |
src/struct.c
Outdated
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.
Typo in comment.
Can we actually please figure out why you had to rewrite legit code. The problem only appeared on Win which is quite weird when you look at your phobos pull. |
This can be reproduced by adding the line: to struct Date and running with the master dmd. It's some other problem. |
|
This error looks a bit like the pull messed up trySemantic, just a guess though. |
|
Added it as: https://issues.dlang.org/show_bug.cgi?id=13719 |
|
Any objections against this change in general? |
|
@WalterBright it would be fairly interesting to get your opinion on this. |
|
I'm uneasy with this. Why would you need to check the invariant before destroying structs/classes that don't have a destructor? No code could ever use that value again. |
|
Ping, @WalterBright what do you think? |
Same as always, to check for bugs. Live objects should always be in a valid state, even if they are headed for the gallows. |
I think this should be pulled. |
I replied in the n.g. |
|
@WalterBright we should pull this. Rebase? |
|
rebased for ddmd |
|
@WalterBright @MartinNowak status? |
Walter is right - object should be valid for destruction |
|
@WalterBright need rebase |
|
|
legit errors in autotester |
…constructor/destructor
|
ping @WalterBright |
|
Rebased patch in #7536. |
fix https://issues.dlang.org/show_bug.cgi?id=519
Will follow up with change to spec.