problem with redefine "`<<" and "`>>" operation
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=4156
Reported by Andrew Shirrayev, andrews@gate.ort.spb.ru
$ pike7.6 -v
Pike v7.6 release 75 Copyright ╘ 1994-2006 LinkЖping University
Pike comes with ABSOLUTELY NO WARRANTY; This is free software and you are
welcome to redistribute it under certain conditions; Read the files
COPYING and COPYRIGHT in the Pike distribution for more details.
Code sample with problem.
class test {
object(test) `/(string str)
{
write("DIV : "+str+"\n");
return this_object();
};
object(test) `+(string str)
{
write("ADD : "+str+"\n");
return this_object();
};
object(test) `<<(string str)
{
write("LEFT:"+str+"\n");
return this_object();
};
}
int main(int argc, array argv)
{
object(test) foo=(test()/"qqq")+"zzz";
// ^^ line w/o problem
object(test) foo1=(test()/"qqq")<<"zzz";
// bug.pike:25:Bad argument 2 to `<<.
// bug.pike:25:Expected: !function(!object ... : mixed) & (function(mixed,
// object : mixed) | function(object, mixed : mixed)) | function(int, int :
// int)
// bug.pike:25:Got : function(mixed | void, string : void | mixed)
// Pike: Failed to compile script:
// Compilation failed.
}