On Thu Jun 28 01:11:14 2012, [email protected] wrote:
> <not_gerd> rn: sub ($ = 42 --> Int) { ... }
> <p6eval> niecza v19-4-g12b71c7: ( no output )
> <p6eval> ..rakudo 88a9d6: OUTPUT«===SORRY!===Missing blockat
> /tmp/rjG5cSGHkE:1»
I ran into this with a named subroutine but noticed there that the
prefix form of declaring the return type seems to be effective as a
workaround.
So
sub foo(Int $x = 3 --> Rat) { return $x / 2}
unsurprisingly gives the same error but
my/our Rat sub foo(Int $x = 3) { return $x / 2}
seems to work as expected.