# New Ticket Created by Tobias Leich # Please include the string: [perl #123596] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=123596 >
FROGGS: m: multi car($x, [$y, @ys] where $x == 1) {1}; say car 1, [1, [2, 3]]; camelia: rakudo-moar d69491: OUTPUT«1» FROGGS: m: multi car($x, [$y, @ys] where $x == $y) {1}; say car 1, [1, [2, 3]]; camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» And also: andreoss: m: multi car($x, [$y, @ys] where $x == $y) {1}; say car 1, [1,2,3]; camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» andreoss: could that be a bug? moritz: m: say 1 == [1, 2, 3] camelia: rakudo-moar d69491: OUTPUT«False» moritz: m: multi car($x, [$y, *@ys] where $x == $y) {1}; say car 1, [1, 2, 3] camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» moritz: m: multi car($x, [$y, *@ys] where { $x == $y }) {1}; say car 1, [1, 2, 3] camelia: rakudo-moar d69491: OUTPUT«Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» moritz: huh moritz: m: multi car($x, [$y, *@ys] where { say (:$x, :$y).perl; $x == $y }) {1}; say car 1, [1, 2, 3] camelia: rakudo-moar d69491: OUTPUT«("x" => 1, "y" => Mu)Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D…» moritz: m: multi car($x, @ [$y, *@ys] where { say (:$x, :$y).perl; $x == $y }) {1}; say car 1, [1, 2, 3] camelia: rakudo-moar d69491: OUTPUT«("x" => 1, "y" => Mu)Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D…» moritz: m: sub f($x, [$y, *@ys]) { say (:$x, :$y, :@ys).perl }; f 1, [2, 3, 4] camelia: rakudo-moar d69491: OUTPUT«("x" => 1, "y" => 2, "ys" => [3, 4])» moritz: m: sub f($x, [$y, *@ys] where { say $y.perl } ) { say (:$x, :$y, :@ys).perl }; f 1, [2, 3, 4] camelia: rakudo-moar d69491: OUTPUT«Cannot call method 'perl' on a null object in sub f at /tmp/UT7XBanYbi:1 in block <unit> at /tmp/UT7XBanYbi:1» moritz: andreoss: seems like variables extracted from subsignatures aren't available in where-blocks moritz: andreoss: and yes, that's a bug