Hello all, given this simple program: sub MAIN( Str :$dir where { .so && .IO.d // warn "Specify the directory [$dir]" } ) { say $dir; }
it works as I expect on ancient versions of rakudo, e.g., 202-01, but it fails miserably on current rakudo: % raku ~/tmp/test.p6 --dir=foo Use of uninitialized value of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block at /home/luca/tmp/test.p6 line 4 Specify the directory [] in block at /home/luca/tmp/test.p6 line 4 Specify the directory [foo] in block at /home/luca/tmp/test.p6 line 4 Use of uninitialized value of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block at /home/luca/tmp/test.p6 line 4 Specify the directory [] in block at /home/luca/tmp/test.p6 line 4 Usage: /home/luca/tmp/test.p6 [--dir=<Str where { ... }>] Note that in the above output there is a point, in the middle, where the wanr function has the value of the argument, so I don't understand why it is complaining. Is there a way to spurt a warn message in the case a parameter is not fine? Thanks, Luca