# New Ticket Created by Zoffix Znet
# Please include the string: [perl #132275]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=132275 >
If you `temp` a variable and access it from within a Promise at a time AFTER
the flow
left the block, you'll get the untempted version:
m: my $x = 42; { my $x = 70; start { sleep 1; say $x; } }; sleep 2
rakudo-moar 4b8a0e: OUTPUT: «70»
m: my $x = 42; { temp $x = 70; start { sleep 1; say $x; } }; sleep 2
rakudo-moar 4b8a0e: OUTPUT: «42»
m: my $x = 42; { temp $x = 70; start { say $x; }; sleep 1 }; sleep 2
rakudo-moar 4b8a0e: OUTPUT: «70»
This sorta makes sense if you squint, but makes `temp` somewhat less useful.
Was wondering if there's a way to make this Just Work and for the Promise to
output the temped value (so all cases above would output `70`)
IRC: https://irclog.perlgeek.de/perl6-dev/2017-10-12#i_15293619