bogus `type mismatch' warning
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=2768
Reported by Robert J. Budzynski, Warsaw University, Dept. of Physics Robert.Budzynski@fuw.edu.pl
Running the following script (foo.pike):
#!/usr/local/bin/pike -w
#pragma strict_types
int main(int ac, array(string) av)
{
write(version()+"\n");
int(-1..1) foo=0;
if(ac>1)
{
if(av[1]=="1") foo++;
else foo--;
}
switch(foo)
{
case 1: write("foo is one\n"); break;
case -1: write("foo is minus one\n"); break;
case 0: write("foo is zero\n"); break;
default: write("Bah!\n");
}
return 0;
}
// script ends here
I obtain the output
$ ./foo.pike xxx
foo.pike:15: Warning: Type mismatch in case.
foo.pike:15: Warning: Expected: int(-1..1)
foo.pike:15: Warning: Got : int
Pike v7.3 release 14
foo is minus one