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

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|RESOLVED                    |REOPENED
                 CC|                            |[email protected]
         Resolution|INVALID                     |---

--- Comment #3 from [email protected] ---
(In reply to Alexander Tumin from comment #2)
> According to cast table from https://dlang.org/spec/const3.html this is not
> bug at all and should be the defined behavior; const(char)[], what ['z'] is,
> cannot be implicitly converted to immutable(char)[], which what the string
> is.

`['z']` is an array literal, though. They're more flexible than that.

For example, dmd accepts these:
----
immutable(int)[] a = [1, 2, 3];
string s = ['z'];
Quu q = Quu(['z']);
----

I see no reason why the code in the description should be rejected when
`Quu(['z'])` is accepted usually. Reopening.

--

Reply via email to