Reproduces both on pike 8 from apt repository and pike compiled on master: $ ./pike -v Pike v8.1 release 13 Copyright © 1994-2018 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. $ $ cat automap1.pike int main() { write( "%O\n", combine_path("foo", ({ "abc", "cde" })[*] ) ); } $ $ cat automap2.pike int main() { string s = "foo"; write("%O\n", combine_path(s, ({ "abc", "cde" })[*] ) ); } $ $ ./pike automap1.pike ({ /* 2 elements */ "foo/abc", "foo/cde" }) $ $ ./pike automap2.pike automap2.pike:4:[*] not supported here. Pike: Failed to compile script. $ $ pike -v Pike v8.0 release 498 Copyright © 1994-2017 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. $ pike automap1.pike ({ /* 2 elements */ "foo/abc", "foo/cde" }) $ $ pike automap2.pike automap2.pike:4:[*] not supported here.
Reproduces both on pike 8 from apt repository and pike compiled on master: $ ./pike -v Pike v8.1 release 13 Copyright © 1994-2018 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. $ $ cat automap1.pike int main() { write( "%O\n", combine_path("foo", ({ "abc", "cde" })[*] ) ); } $ $ cat automap2.pike int main() { string s = "foo"; write("%O\n", combine_path(s, ({ "abc", "cde" })[*] ) ); } $ $ ./pike automap1.pike ({ /* 2 elements */ "foo/abc", "foo/cde" }) $ $ ./pike automap2.pike automap2.pike:4:[*] not supported here. Pike: Failed to compile script. $ $ pike -v Pike v8.0 release 498 Copyright © 1994-2017 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. $ pike automap1.pike ({ /* 2 elements */ "foo/abc", "foo/cde" }) $ $ pike automap2.pike automap2.pike:4:[*] not supported here.
Interesting bug; note that the following code works:
| $ cat automap3.pike | int main() { | string s = "foo"; | array a = ({ "abc", "cde" }); | write("%O\n", combine_path(s, a[*] ) ); | }
Which indicates that the problem lies in the compiler attempting to constant-fold the expression
({ "abc", "cde" })[*]
Which is not possible as it has a naked auto map marker.
Fixed in Pike master.
/grubba
pike-devel@lists.lysator.liu.se