On 11/23/16 1:03 PM, Chris wrote:
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.


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.


Please file here: https://issues.dlang.org/enter_bug.cgi

I think this has been there forever. Happens in 2.040 too (the earliest dmd I have on my system).

-Steve
  • Switch ignores case (?) Chris via Digitalmars-d-learn
    • Re: Switch ignores case ... Steven Schveighoffer via Digitalmars-d-learn
      • Re: Switch ignores c... Chris via Digitalmars-d-learn
        • Re: Switch ignor... Steven Schveighoffer via Digitalmars-d-learn
          • Re: Switch i... Chris via Digitalmars-d-learn
            • Re: Swi... Jonathan M Davis via Digitalmars-d-learn
            • Re: Swi... ketmar via Digitalmars-d-learn
              • Re:... Chris via Digitalmars-d-learn
                • ... ketmar via Digitalmars-d-learn
                • ... ketmar via Digitalmars-d-learn
              • Re:... Steven Schveighoffer via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... ketmar via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn

Reply via email to