-
-
Notifications
You must be signed in to change notification settings - Fork 610
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 14730 - Wrong closure var access with -inline #4765
Conversation
| struct S | ||
| { | ||
| int n; | ||
| int get() { return x; } // x will be a cloaure variable |
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.
closure, not cloauasre (I gave up trying to type the typo)
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.
Ouch. Fixed!
|
I noticed that, moving the closure vars offset calculation into front-end will cause breaking of currently working code. Look at the added test case But I think it's questionable behavior, because I also found a @nogc violation issue around that. Anyway, I changed the bugfix way to more conservative. |
|
Rebased on master, and ready for ddmd. |
|
|
OK. |
|
Auto-merge toggled on |
It's necessary to avoid breaking of test14730x(). But I think it's questionable. See: https://issues.dlang.org/show_bug.cgi?id=14771
Issue 14730 - Wrong closure var access with -inline
https://issues.dlang.org/show_bug.cgi?id=14730