You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to modify an ro parameter, or the parameter to a for loop (which, when using ->, I guess is another sort of ro parameter), I get one of the two error messages:
sub foo(Str $str) {
$str ~= 'another'; # Cannot assign to an immutable value
$str .= substr(0, 3); # Cannot modify an immutable Str
}
I've also seen "Cannot assign to a readonly variable or a value".
While the error message makes sense, it may be nice to...
- Indicate the variable being assigned to, if it is indeed a variable.
- (In the case of the linked ticket mentioning $/) Indicate the operation responsible for the writing
- (Other than for $/) Suggest is copy or <-> if that is what the user means.
If I try to modify an ro parameter, or the parameter to a for loop
(which, when using ->, I guess is another sort of ro parameter), I get
one of the two error messages:
sub foo(Str $str) {
$str ~= 'another'; # Cannot assign to an immutable value
$str .= substr(0, 3); # Cannot modify an immutable Str
}
I've also seen "Cannot assign to a readonly variable or a value".
While the error message makes sense, it may be nice to...
- Indicate the variable being assigned to, if it is indeed a variable.
- (In the case of the linked ticket mentioning $/) Indicate the
operation responsible for the writing
- (Other than for $/) Suggest is copy or <-> if that is what the user
means.
"Cannot assign to a readonly variable or a value" occurs with for loop parameters.
p6rt
added
the
LTA
Less Than Awesome; typically an error message that could be better
label
Jan 5, 2020
Migrated from rt.perl.org#125590 (status was 'new')
Searchable as RT125590$
The text was updated successfully, but these errors were encountered: