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

--- Comment #3 from yebblies <[email protected]> ---
(In reply to bearophile_hugs from comment #2)
> 
> One way to rewrite it is (the immutable can't be always used):
> 

While re-writes are certainly the simplest way to explain it, using them in the
compiler often leads to complications, especially with error messages referring
to the re-written code instead of the original.

For this case, and similar cases, the compiler can simply type the array
literal as a static array, because it knows that == can't escape any
references.  It already does something like this for indexing array literals.

--

Reply via email to