Types for constants in the program are wrong.
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=1219
Reported by Per Hedbor, Idonex per@roxen.com
Jag använder Pike v7.0 release 312 på Linux, dvs den Pike som kom med i Roxen WebServer 2.1.231 (filen "roxen-2.1.231-lrh6.2.sh"). Det här måste väl vara en bug i typkontrollen?
#!/usr/local/bin/pike
#pragma strict_types
class C {
static void create( array(string) sa1, array(string) sa2) { }
} // class C
int main() {
C c1 = C( ({ "a" }), ({ "a" }) );
C c2 = C( ({ "a" }), ({ "a", "b" }) );
return 0;
}
Jag får en varning på initialiseringen av c2 (men inte c1):
foo.pike:10: Warning: Arguments not strictly compatible.
foo.pike:10: Warning: Expected: function(array(string), array(string) :
object(is 65579))
foo.pike:10: Warning: Got : function(array(string), array : void |
mixed)
Futher digging revealed:
> typeof( ({ "a", "b", "c" }) );
Result: array(string)
> _typeof( ({ "a", "b", "c" }) );
Result: array
Basically, the problem is that array (and perhaps other complex types?) constants in the program code does not get the correct type.