[Issue 15711] Incorrect type inferring of [char]/string when passed via recursive template, extracting it from a structure field
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Feb 24 14:46:31 PST 2016
https://issues.dlang.org/show_bug.cgi?id=15711
--- Comment #2 from Alexander Tumin <iamtakingiteasy at eientei.org> ---
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.
The solution to this case is simply wrap ['z'] into cast(string)(['z']) and all
should work just fine. I'm sorry, this should be closed as not a bug.
--
More information about the Digitalmars-d-bugs
mailing list