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

--- Comment #3 from Steven Schveighoffer <[email protected]> ---
(In reply to Steven Schveighoffer from comment #2)
> I'm not sure why Martin did it the way he did. I'll ask him.

No response from him, but I tried using your suggestion. It doesn't work
(std.datetime fails to compile).

The issue is that the template is passed in the string literals as the type of
the value to switch on. So if you pass in a const(char)[] to test, the literals
are passed in as const(char)[].

Which means, even though they are compile-time literals, they don't convert to
immutable(char)[].

But I have found an answer that is less complex and just uses a cast. PR
imminent.

--

Reply via email to