On Wednesday, 23 November 2016 at 17:33:04 UTC, Steven Schveighoffer wrote:


I tested this locally with different ideas. This definitely looks like a codegen bug.

I was able to reduce it to:

void main()
{
    switch("'"d)
    {
    case "'"d:
        writeln("a");
        break;
    case "’"d:
        writeln("b");
        break;
    default:
        writeln("default");
    }
}

prints "default"

What seems to fix it is removing the case statement for the "smart apostrophe". So I'd look there for where the bug is triggering.

-Steve

Yep, removing one of the two cases works. I tried it with different versions of dmd back to 2.070.0, and it always gives me the same (wrong) result. I haven't tried ldc yet.

Reply via email to