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

Ate Eskola <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Ate Eskola <[email protected]> ---
I'm a bit on the fence on whether I agree with this being a regression.
However, I should declare conflict of interest. I was the one who wrote the
optimisation that broke this so potentially I'm just excusing my shortcomings.

The issue here is you're not really depending on what `chain` by itself does.
Instead, you're depending on the initial state of it's type, which is
undocumented and therefore, arguably implementation-defined. In principle you
can expect predictable behaviour from the type only if you initialise it or
assign to it with the `chain` function.

On the other hand, in practice we do depend on stuff like this every now and
then anyway. The `.init` value for `Chain` type could be calculated at compile
time so that it'd agree with the `chain` function call when all the subranges
are also at their `.init` value. I think this is would be an improvement, but
I'm not sure whether it'd qualify as a real regression fix.

--

Reply via email to