The line around 2778 in the SwitchStatement semantic code: sl.expressionSemantic(sc); should be: sl = sl.expressionSemantic(sc); otherwise the results of the function are lost.
@WalterBright created dlang/dmd pull request #12133 "fix Issue 21553 - incorrect call to expressionSemantic() in statement…" fixing this issue: - fix Issue 21553 - incorrect call to expressionSemantic() in statementsem.d https://github.com/dlang/dmd/pull/12133
dlang/dmd pull request #12133 "fix Issue 21553 - incorrect call to expressionSemantic() in statement…" was merged into master: - 90e8313f1fdb3c79bed25f4ae41d8d706b8d60de by Walter Bright: fix Issue 21553 - incorrect call to expressionSemantic() in statementsem.d https://github.com/dlang/dmd/pull/12133