[perl #129874] [BUG] Strange closure-related issue in block interpolation

2016-10-13 Thread Zoffix Znet via RT
Spoke too soon. The issue is the Nil return type constraint. Golfed:

 m: sub (-->Nil) { fail "{42}"; }()
 rakudo-moar a09c8d: OUTPUT«Use of Nil in string context␤  in sub  at 
 line 1␤␤  in sub  at  line 1␤  in block  at  line 
1␤␤Actually thrown at:␤  in block  at  line 1␤␤»


On Thu Oct 13 18:31:07 2016, c...@zoffix.com wrote:
> 
>  Hm. Found a strange bug in core that I can't reproduce.
>  m: Bag.new-from-pairs: 1 => -1;
>rakudo-moar a09c8d: OUTPUT«Use of Nil in string context␤
> in
>   block  at  line 1␤Use of Nil in string context␤  in block
>at  line 1␤Found negative values for  in ␤  in block
>at  line 1␤␤Actually thrown at:␤  in block  at
> 
> l…»
>Those Nils? It's the two interpolated blocks on this line:
> https://github.com/rakudo/rakudo/blob/a09c8dc99ef7ae60876ad7a7cc478f7e303eb804/src/core/Baggy.pm#L48
>If I change it to this: my $wat = @toolow.join:  ' '; my
>   $name = self.^name; fail "Found negative values for $wat in $name"
> if
> @toolow;  then the bug goes away.
>m: role Foo { method !meow { my @meows = ;
> fail
>   "some {@meows}" if @meows; }; method moo { self!meow; 42 } }; class
> ::
> does Foo {}.moo
>rakudo-moar a09c8d: OUTPUT«some foo bar ber␤  in method
> meow
>   at  line 1␤  in method moo at  line 1␤  in block  at
>line 1␤␤Actually thrown at:␤  in method moo at  line 1␤
> in
> block  at  line 1␤␤»
>  But can't reproduce it ^ :/
> 
> https://irclog.perlgeek.de/perl6-dev/2016-10-14#i_13399643





[perl #129874] [BUG] Strange closure-related issue in block interpolation

2016-10-13 Thread via RT
# New Ticket Created by  Zoffix Znet 
# Please include the string:  [perl #129874]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=129874 >



 Hm. Found a strange bug in core that I can't reproduce.
 m: Bag.new-from-pairs: 1 => -1;
 rakudo-moar a09c8d: OUTPUT«Use of Nil in string context␤  in  
block  at  line 1␤Use of Nil in string context␤  in block  
 at  line 1␤Found negative values for  in ␤  in block  
 at  line 1␤␤Actually thrown at:␤  in block  at   
l…»
 Those Nils? It's the two interpolated blocks on this line:  
https://github.com/rakudo/rakudo/blob/a09c8dc99ef7ae60876ad7a7cc478f7e303eb804/src/core/Baggy.pm#L48
 If I change it to this: my $wat = @toolow.join:  ' '; my  
$name = self.^name; fail "Found negative values for $wat in $name" if  
@toolow;  then the bug goes away.
 m: role Foo { method !meow { my @meows = ; fail  
"some {@meows}" if @meows; }; method moo { self!meow; 42 } }; class ::  
does Foo {}.moo
 rakudo-moar a09c8d: OUTPUT«some foo bar ber␤  in method meow  
at  line 1␤  in method moo at  line 1␤  in block  at  
 line 1␤␤Actually thrown at:␤  in method moo at  line 1␤  in  
block  at  line 1␤␤»
 But can't reproduce it ^ :/

https://irclog.perlgeek.de/perl6-dev/2016-10-14#i_13399643