Fix issue 22124 - Corrupted closure with -dip1000 #3520
Fix issue 22124 - Corrupted closure with -dip1000 #3520dkorpel wants to merge 3 commits intodlang:stablefrom
Conversation
|
Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + druntime#3520" |
|
Okay, so it turns out that you can't assign |
|
I'm not sure why |
Yes, and currently it doesn't because the constructor is |
Depends on dlang/dmd#12880
This is really hard to test. The original test case is timing and stack-layout sensitive, so it can pass by luck. I thought maybe
!__traits(compiles, (int i) @nogc => new Thread({i = 3;}))but sinceThreadis a class, that will fail anyway. I could doscope t = new Thread(), but then it's technically valid to be@nogc, so that's why I call__ctordirectly.