Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Make dotty assignment `.=` work with non-identifier postfixes #3251

Open p6rt opened 11 years ago

p6rt commented 11 years ago

Migrated from rt.perl.org#120272 (status was 'new')

Searchable as RT120272$

p6rt commented 11 years ago

From @Mouq

17​:11 \ r​: my $a .= ++; say $a 17​:11 \ rakudo 455467​: OUTPUT«No such method '&postfix​:\<++>'   for invocant of type 'Any'␤ in method dispatch​:\<.=> at   src/gen/CORE.setting​:1127␤ in block at   /tmp/XiTAa5iKur​:1␤␤» 17​:11 \ r​: my $a .= --; say $a 17​:11 \ rakudo 455467​: OUTPUT«No such method '&postfix​:\<-->'   for invocant of type 'Any'␤ in method dispatch​:\<.=> at   src/gen/CORE.setting​:1127␤ in block at   /tmp/ei3KpLGpwF​:1␤␤»

17​:16 \ r​: sub postfix​:\<!> (\f) { [*] 1..f }; my $n = 4; say $n.!;   $n .= !; say $n; 17​:16 \ rakudo 455467​: OUTPUT«24␤No such method '&postfix​:\<!>'   for invocant of type 'Int'␤ in method dispatch​:\<.=> at   src/gen/CORE.setting​:1127␤ in block at   /tmp/FmTDH49Yug​:1␤␤»

p6rt commented 11 years ago

From @masak

\ I have a regression to report. \ std​: my @​a = 0..4; @​a.=[1, 2]; say @​a \ std 8adbc60​: OUTPUT«ok 00​:01 127m␤» \ rn​: my @​a = 0..4; @​a.=[1, 2]; say @​a \ niecza v24-98-g473bd20​: OUTPUT«1 2␤» \ ..rakudo-jvm 882e33​: OUTPUT«===SORRY!=== Error while compiling /tmp/UuTtIcx5t8␤Cannot use .= on a non-identifier method call␤at /tmp/UuTtIcx5t8​:1␤------> my @​a = 0..4; @​a.=[1, 2]⏏; say @​a␤» \ ..rakudo-parrot bec62b​: OUTPUT«===SORRY!=== Error while compiling /tmp/Ayfc4RauXB␤Cannot use .= on a non-identifier method call␤at /tmp/Ayfc4RauXB​:1␤------> my @​a = 0..4; @​a.=[1, 2]⏏; say @​a␤» * masak submits rakudobug \ I'm pretty sure @​a.=[1, 2]; used to work, because I have recent code that uses it, and just broke when I upgraded Rakudo.