``` void main() { immutable string x, y; switch (y) { case x: break; default: break; } } ``` > onlineapp.d(6): Error: `case` must be a `string` or an integral constant, not `x` x is a string in this case, so the error is nonsensical.
@ntrel created dlang/dmd pull request #14840 "Fix Issue 23635 - Nonsensical "`case` must be a `string` or an integr…" fixing this issue: - Fix Issue 23635 - Nonsensical "`case` must be a `string` or an integral constant, not `x`" https://github.com/dlang/dmd/pull/14840
dlang/dmd pull request #14840 "Fix Issue 23635 - Nonsensical "`case` must be a `string` or an integr…" was merged into master: - e1938d27555ca034b6eaa10be827fedce1031b81 by Nick Treleaven: Fix Issue 23635 - Nonsensical "`case` must be a `string` or an integral constant, not `x`" https://github.com/dlang/dmd/pull/14840