digitalmars.D.bugs - switch bug
- BCS <ao pathlink.com> Mar 24 2007
- Lionello Lunesu <lio lunesu.remove.com> Mar 26 2007
import std.stdio;
void main(char[][] argv)
{
switch("#!")
{
case "#!": writef("----Found #!\n"); break;
case "\xFF\xFE"c: break;
default: writef("----Found ASCII\n"); break;
}
}
On dmd 1.009 linux and win32 this prints "----Found ASCII". Drop the middle
case and it prints "----Found #!".
Mar 24 2007
BCS wrote:import std.stdio; void main(char[][] argv) { switch("#!") { case "#!": writef("----Found #!\n"); break; case "\xFF\xFE"c: break; default: writef("----Found ASCII\n"); break; } } On dmd 1.009 linux and win32 this prints "----Found ASCII". Drop the middle case and it prints "----Found #!".
I can confirm this bug (dmd 1.010, win32) L.
Mar 26 2007








Lionello Lunesu <lio lunesu.remove.com>