[Issue 22239] Can't migrate from postblits if they are used without frame pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 26 12:21:28 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22239

--- Comment #3 from Ate Eskola <Ajieskola at gmail.com> ---
That last example is supposed to fail. `PostBlitted!(x => x)` contains a hidden
context pointer to `main` to construct, so they can be default-initialized only
at `main`. Not at `f`.

(It could be argued that no frame pointer should be needed because `x => x`
does not use any variables from `main`, but that's a different issue)

Default blittings, and thus postblits, work, because the hidden context pointer
gets copied from the original instance.

But I can't come up with a way to do the same with a copy constructor. Well, I
suppose I could devise a workaround with `static opCall`, but we're supposed to
replace postblits with copy constructors, not with hackish workarounds.

--


More information about the Digitalmars-d-bugs mailing list