[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/efc7377ec02c19377366bf9eb80ed7b3653b457c add test for issue 16739 - switch ignores case https://github.com/dlang/druntime/commit/2411c52cbc31693e0a46fa06fb592787c9634ef0 Merge pull request #2064 from aG0aep6G/16739 add test for issue 16739 - switch ignores case merged-on-behalf-of: Andrei Alexandrescu --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 ag0ae...@gmail.com changed: What|Removed |Added Keywords|wrong-code | Component|dmd |druntime Resolution|WORKSFORME |FIXED --- Comment #5 from ag0ae...@gmail.com --- Apparently this was actually a Druntime bug, and it was fixed by https://github.com/dlang/druntime/pull/1952 New PR for the test: https://github.com/dlang/druntime/pull/2064 --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 ag0ae...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #4 from ag0ae...@gmail.com --- Works for me now with 2.078.0. Pull request to add a test: https://github.com/dlang/dmd/pull/7793 --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 --- Comment #3 from Ketmar Dark --- as i am incompatible with github ;-), anybody is, of course, free to take my hackfix and turn it into real fix (mostly by adding unittests, i guess). no credits required. --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 Ketmar Dark changed: What|Removed |Added CC||ket...@ketmar.no-ip.org --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 --- Comment #2 from Steven Schveighoffer --- Interesting find by ketmar in https://forum.dlang.org/post/cvfdiwxvdkcyrfhew...@forum.dlang.org The binary search through the list of possible strings is flawed -- it uses memcmp to do the binary search, and so allows the endianness of the machine to mess with the results. --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com --
[Issue 16739] switch ignores case
https://issues.dlang.org/show_bug.cgi?id=16739 ag0ae...@gmail.com changed: What|Removed |Added Keywords||wrong-code CC||ag0ae...@gmail.com --- Comment #1 from ag0ae...@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. --