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


<lizmat>        m: sub a(--> 42) { { return } }; dd a   # expected 42
<+camelia>      rakudo-moar f2894d: OUTPUT«Nil␤»
<lizmat>        jnthn: am I wrong in expecting that?  ^^^
<jnthn> What were you expecting?
<jnthn> Looks right to me.
<jnthn> m: sub a(--> 42) { return }; dd a
<+camelia>      rakudo-moar f2894d: OUTPUT«42␤»
<jnthn> How does that one work?
<jnthn> I thought the --> was just for the fall-off-the-end though...
<lizmat>        jnthn: apparently not ?
<lizmat>        m: sub a(--> 42) { return 666 }
<+camelia>      rakudo-moar f2894d: OUTPUT«===SORRY!=== Error while compiling 
<tmp>␤No return arguments allowed when return value 42 is already specified in 
the signature␤at <tmp>:1␤------> sub a(--> 42) { return 666 ⏏}␤»
<lizmat>        jnthn: so I guess a bare return is sorta expected in this case 
<jnthn> m: sub a(--> 42) { if 1 { return 666 } }
<+camelia>      rakudo-moar f2894d: ( no output )
<jnthn> Fail
<jnthn> m: sub a(--> 42) { if 1 { return } }; say a
<+camelia>      rakudo-moar f2894d: OUTPUT«Nil␤»
<jnthn> That's a pretty bad discrepancy
<jnthn> m: sub a(--> 42) { return }; say a
<+camelia>      rakudo-moar f2894d: OUTPUT«42␤»
jnthn   wonders how that works :)
<lizmat>        rakudobug material ?
<jnthn> Surely
<jnthn> I didn't even know we had that feature :P

Reply via email to