perl6 -e 'sub foo($a where {* < 5}) { dd $a }; foo(3);'
===SORRY!=== Error while compiling -e
Malformed double closure; WhateverCode is already a closure without
curlies, so either remove the curlies or use valid parameter syntax instead
of *
at -e:1
------> sub foo($a where {* < 5}⏏) { dd $a }; foo(3);
expecting any of:
horizontal whitespace
statement end
statement modifier
statement modifier loop
but
perl6 -e 'sub foo($a where {* < 5 and * > 9}) { dd $a }; foo(3);'
Int $a = 3
There's no error and the (impossible) where clause is ignored.
On Sat Oct 01 07:02:34 2016, ddgreen@gmail.com wrote:
perl6 -e 'sub foo($a where {* < 5}) { dd $a }; foo(3);'
===SORRY!=== Error while compiling -e
Malformed double closure; WhateverCode is already a closure without
curlies, so either remove the curlies or use valid parameter syntax instead
of *
at -e:1
------> sub foo($a where {* < 5}⏏) { dd $a }; foo(3);
expecting any of:
horizontal whitespace
statement end
statement modifier
statement modifier loop
but
perl6 -e 'sub foo($a where {* < 5 and * > 9}) { dd $a }; foo(3);'
Int $a = 3
There's no error and the (impossible) where clause is ignored.
It's not just where there are multiple *s, it seems to be whenever there's more than one expression
perl6 -e 'sub foo($a where {* < 5 or $a > 9}) { dd $a }; foo(6);'
Int $a = 6
Migrated from rt.perl.org#129780 (status was 'resolved')
Searchable as RT129780$
The text was updated successfully, but these errors were encountered: