# New Ticket Created by Adrian Kreher # Please include the string: [perl #123835] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=123835 >
I tried 'sub f($x is rw = 60)', STD parses it but rakudo prohibits it. 'is copy' works. I don't see any obvious reason why it shouldn't work. This is perl6 version 2015.01-141-gfec2339 built on MoarVM version 2015.01-34-g2d7eddb 143936 avuserow | m: sub f($x is rw = 60) {$x++; say $x}; f 143937 +camelia | rakudo-moar 949b80: OUTPUT«?31m===?0mSORRY!?31m===?0m Error while compiling /tmp/L9ZwKOd6I3Cannot use 'is rw' on an optional parameterat /tmp/L9ZwKOd6I3:1------> » 144045 avuserow | std: sub f($x is rw = 60) {$x++; say $x}; f 144046 +camelia | std f9b7f55: OUTPUT«ok 00:00 140m» 144058 avuserow | rakudobug? 144141 masak | no, I don't think so. 144149 masak | or, hm. 144210 masak | I don't immediately see what the problem is with using 'is rw' on an optional parameter... 144227 masak | sometimes it doesn't bind with the outside, but that's not a show-stopper. 144253 masak | avuserow: please submit it and we can have a discussion of why it should or should not be possible ;) In the "Parameter traits" section of S06, it mentions about 'is rw' and defaults, saying this should be allowed in some cases. But I'm not sure if that applies to this case or not.