# New Ticket Created by  "Brian S. Julin" 
# Please include the string:  [perl #125437]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125437 >


# Attributive parameters can load themselves into objects during
# seemingly innocent smartmatches, and probably other places where
# is_bindable semantics are intended.
perl6 -e 'class a { has $.a; method foo { say so (self,2) ~~ :(\self: $!a); 
self.a.say } }; a.new.foo()'
True
2

#...like multidispatch tests
$ for i in 1 2 3 4 5; do perl6 -e 'my $*r; class A { has $.a = 4; multi method 
foo (A $b (:$!a), Int $c where { $*r //= Bool.pick }) { 42.say }; multi method 
foo (A $b, Int $c) { self.a.say } }; my A $a .= new; my A $b .= new(:a(2)); 
$a.foo($b,1);' ; done
2
2
42
2
42
# (above, $a.a should only be 2 when 42 is printed, should otherwise be 4.)

Reply via email to