Lowerings to strongly pure _d_arrayctor trigger warnings or risk being incorrectly removed

Johan j at j.nl
Tue Oct 12 16:46:10 UTC 2021


On Tuesday, 12 October 2021 at 16:27:51 UTC, Teodor Dutu wrote:
> Hi,
>
> I've been working on [this 
> PR](https://github.com/dlang/dmd/pull/13116) for a while now 
> and after seeing it fail some tests in phobos (for example, 
> [this 
> one](https://cirrus-ci.com/task/5609501660282880?logs=test_phobos#L116)), my mentors for SAoC 2021, Razvan Nitu and Eduard Staniloiu, and I figured out that, when lowered using `const` or `immutable` arguments, `_d_arrayctor` becomes a strongly pure function.

Why would you want to instantiate `_d_arrayctor` multiple times 
for different constness of its arguments?
You can choose the exact details of the lowering, so would your 
problem not be solved by simply lower to calls without 
const/immutable parameter types?

-Johan



More information about the Digitalmars-d mailing list