Some sort of compiler bug
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=2767
Reported by Martin Nilsson, IDA nilsson@pike.ida.liu.se
The following code
mapping basun = ([ "foo":Image.Image(10,10) ]);
add_constant("basun", basun);
program p = compile_string("Image.Image i=basun.foo;\n"
"mixed x() { return basun; }", "-");
gives the following error
-:1:Couldn't store constant.
`==: illegal argument 2
Pike/7.3/build/sunos-5.8-i86pc/test-install/pike/7.3.16/lib/modules/Image.s
o.image:
Image.Image( 10 x 10 /* 0.3Kb */)->`==(mapping[1])
Pike/7.3/build/sunos-5.8-i86pc/test-install/pike/7.3.16/lib/master.pike:223
:
master()->compile_string("Image.Image i=basun.foo;\nmixed x() { return
basun; }","-",0)
If however the declaration of i is removed of the return is changed from basun to i it works.