# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #114394] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=114394 >
<nebuchadnezzar> hi <nebuchadnezzar> looking at perl6 book, I tried the examples and find something curious: http://pastebin.com/v835G1MD <nebuchadnezzar> "given" in the sub does not seems to behave the same way as outside * masak is looking into it now <masak> reproduced the bug locally. <masak> golfing. <masak> r: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; sub p($a, $b) { w $a, $b }; say p(R, R); say w(R, R) <p6eval> ..rakudo 7e1b38: OUTPUT«-10» * masak submits rakudobug <masak> r: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; (-> $a, $b { say w $a, $b })(R, R); say w R, R <p6eval> rakudo 7e1b38: OUTPUT«-10» <masak> correction: the parameter binding is messing it up somehow. <jnthn> masak: Was the issue there with star? <masak> star: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; (-> $a, $b { say w $a, $b })(R, R); say w R, R <p6eval> star 2012.07: OUTPUT«-10» <masak> yep. <jnthn> OK, not a qast related regression then. <masak> r: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; my ($a, $b) = (-> $a, $b { $a, $b })(R, R); say w $a, $b <p6eval> rakudo 7e1b38: OUTPUT«-1» <masak> curiouser and curiouser. <masak> r: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; my ($a, $b) = R, R; say w $a, $b <p6eval> rakudo 7e1b38: OUTPUT«-1» <masak> a-ha! <masak> not parameter binding. variables! <masak> containers, most like. <masak> r: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; my @x = R, R; say w(|@x) <p6eval> rakudo 7e1b38: OUTPUT«-1» <masak> aye. <jnthn> Hm <jnthn> Can you make it happen without type catpures? <jnthn> Or are they a necesary part of it? <masak> I have a hunch they are. <masak> r: class R {}; multi w(R, R) { 0 }; multi w($, $) { -1 }; my @x = R, R; say w(|@x) <p6eval> rakudo 7e1b38: OUTPUT«0» <masak> aye. they are part of it. <masak> r: class R {}; multi w(::T, T) { 0 }; multi w($, $) { -1 }; say w(|[R, R]) <p6eval> rakudo 7e1b38: OUTPUT«-1» <masak> r: multi w(::T, T) { 0 }; multi w($, $) { -1 }; say w(|[1, 1]) <p6eval> rakudo 7e1b38: OUTPUT«-1» <masak> r: multi w(::T, T) { 0 }; multi w($, $) { -1 }; say w(1, 1) <p6eval> rakudo 7e1b38: OUTPUT«0» * masak loves golfin' :) <masak> r: sub w(::T, T) { 0 }; say w(|[1, 1]) <p6eval> rakudo 7e1b38: OUTPUT«Nominal type check failed for parameter ''; expected Scalar but got Int instead in sub w [...] <masak> yay, I tricked Rakudo into telling me what's wrong, even! <jnthn> masak++ # that makes it rather clearer * masak does a victory dance