-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
RSC ReviewThis issue will be reviewed by the RSC and decided upon soonThis issue will be reviewed by the RSC and decided upon soonlanguageChanges to the Raku Programming LanguageChanges to the Raku Programming Language
Description
Currently, if writing:
sub foo(Num() $n is rw) { $n++ }
Then we can call it successfully like this:
my $x = 1e0;
foo($x);
dd $x; # Num $x = 2e0
However, if the coercion is applied, such as in this case:
my $x = 1;
foo($x);
Then it binds the result of the coercion to $n
in foo
, resulting in an error since ++
is being done on an immutable value. This is almost certainly the result of not having considered how this interaction should work.
Metadata
Metadata
Assignees
Labels
RSC ReviewThis issue will be reviewed by the RSC and decided upon soonThis issue will be reviewed by the RSC and decided upon soonlanguageChanges to the Raku Programming LanguageChanges to the Raku Programming Language