[Issue 3652] Allow explicit and implicit casting of dynamic array slices of known size to static array

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 15 16:11:38 UTC 2020


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

Witold Baryluk <witold.baryluk+d at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Witold Baryluk <witold.baryluk+d at gmail.com> ---
It does appear way better indeed.


https://godbolt.org/z/taxeAR

One way to emulate, the foo(xs[i .. i+4]), is by doing foo(xs[i .. i+4][0 ..
4]).

It is hard to support arbitrary expression. Not only it would be very hard to
write specification to indicate what kind of expressions are supported by
compiler.

in general function equality is equivalent to halting problem, so only some
poorly defined subset (by algorithm) can be supported. compiler is not full
symbolic algebra system, so it is probably not worth implementing or
specifying.

Thanks for the patches, Kenji.

--


More information about the Digitalmars-d-bugs mailing list