Hi, On 18.12.2016 15:35, Wenzel Peppmeyer (via RT) wrote: > # New Ticket Created by Wenzel Peppmeyer > # Please include the string: [perl #130371] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=130371 > > > > my &block = { say 'returning from &block'; return }; > sub returned-from(&code) { say 'enter returned-from'; code; say 'leave > returned-from' }; > sub forcing-a-return { returned-from &block }; > forcing-a-return; > > # OUTPUT«enter returned-fromreturning from &blockAttempt to return outside > of any Routine in block <unit> at <tmp> line 1» > # expected > # OUTPUT«enter returned-fromreturning from &block» > # this may be a regression caused by a4ca12afa30be4ce5dfc3602f54a5563d069ffa5
I'm pretty sure that's not a bug; &return is supposed to be tied to the lexically outer Routine, and in this example, there is no lexically outer Routine, so the error message is valid. Cheers, Moritz -- Moritz Lenz https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/
