Fixed with https://github.com/rakudo/rakudo/commit/25d0430ab0 , tests needed.
> On 25 May 2017, at 14:48, Aleks-Daniel Jakimenko-Aleksejev (via RT) > <perl6-bugs-follo...@perl.org> wrote: > > # New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev > # Please include the string: [perl #131362] > # in the subject line of all future correspondence about this issue. > # <URL: https://rt.perl.org/Ticket/Display.html?id=131362 > > > > Code: > my $x; $x = 50; 42 = $x > > Result: > Cannot modify an immutable Int > in block <unit> at -e line 1 > > > So which one of the assignments actually failed (both are on the same line)? > > This bug report is motivated by this thinkperl6 exercise: > > • We’ve seen that $n = 42 is legal. What about 42 = $n? > > I think a good error message would be “Cannot modify an immutable Int (42)”, > or whatever else which includes the value itself.