Fix Issue 18828 - [-betterC] helpless error in object.d#2178
Fix Issue 18828 - [-betterC] helpless error in object.d#2178dlang-bot merged 1 commit intodlang:masterfrom JinShil:fix_18828
Conversation
|
Thanks for your pull request, @JinShil! Bugzilla references
|
|
I'm not sure how to test -betterC in the runtime, so, instead, I added a test at dlang/dmd#8235 |
|
Is this testable? |
Yes, at dlang/dmd#8235. I didn't know how else to do it. |
Is this related to how the tests are setup or run in druntime? Because I don't see anything special in that test. |
|
Notice this at the top of the test file: This means the test will be compiled in -betterC mode. In -betterC you cannot use You can see a demonstration of the test currently failing at https://run.dlang.io/is/vPcZNA. Once this is pulled the DMD test should pass. |
|
Not sure about how much work it would be, but what about adding a new directory here: https://github.com/dlang/druntime/tree/master/test ? |
|
I added the directory and test to the best of my ability, but I don't even understand what most of the syntax in the Makefile is for EDIT: See comment below. |
Add |
|
It appears to be running now. I had to add the test to the root posix.mak file and output appeared (e.g. https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=3176138&dataid=22521943&isPull=true search for "betterc"). It appears none of the tests in the |
|
Can we close : dlang/dmd#8235 now ? |
|
Haha, I just went into bugzilla to make a new issue about the inefficiency of destroy, to find that the code I swore was using I'm still going to file an issue, because I feel like smaller structs can be done much more efficiently than casting to ubyte arrays. But this change helps significantly. See: https://forum.dlang.org/post/pe3pcp$13t4$1@digitalmars.com |
|
I don't really like this fix, but I'm not sure how else to do it, and maybe this PR will elicit some ideas from others.