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


using `temp` on a hash key restores its original value when we leave the scope, 
while other keys are free to be modified:

m: my %h = foo => 'bar'; { temp %h<foo> = 'meow'; }; say %h
rakudo-moar d4ac15: OUTPUT«{foo => bar}␤»

m: my %h = foo => 'bar'; { temp %h<foo> = 'meow'; %h<not-foo> = 42; }; say %h
rakudo-moar d4ac15: OUTPUT«{foo => bar, not-foo => 42}␤»


However, if the `temp`ed key did not exist in the original hash, it WILL exist 
after leaving the scope. Expected behaviour: the key does not exist:

m: my %h = foo => 'bar'; { temp %h<not-foo> = 'meow'; }; say %h
rakudo-moar d4ac15: OUTPUT«{foo => bar, not-foo => (Any)}␤»


This issue was originally mentioned in 
https://rt.perl.org/Ticket/Display.html?id=126447 and currently-fudged tests 
exist: 
https://github.com/perl6/roast/commit/9977e560ffddf6c47e621610dfbb384d3c20aa56

Reply via email to