[Issue 16739] switch ignores case

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Nov 23 11:15:05 PST 2016


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

ag0aep6g at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
                 CC|                            |ag0aep6g at gmail.com

--- Comment #1 from ag0aep6g at gmail.com ---
Simplified test case:

----
void main()
{
    int result = 0;
    switch ("a"d)
    {
      case "\u0100"d: result = 1; break;
      case "a"d: result = 2; break;
      default: result = 3; break;
    }
    assert(result == 2); /* fails; result is 3 */
}
----

Seems to be problem with code points > 0xFF. Doesn't fail with "00FF"d instead
of "0100"d.

Also fails with wstrings. Doesn't fail with strings.

--


More information about the Digitalmars-d-bugs mailing list