Skip to content
Permalink
Browse files

Improve assigning immutable value error

Replace: Cannot modify an immutable Any ((Any))
With: Cannot modify an immutable 'Any' type object
  • Loading branch information...
lizmat committed Nov 6, 2018
1 parent 8b93ec9 commit e67584929f4ff2d753d9aa1603ad66962b3f0e96
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/core/Exception.pm6
@@ -2328,9 +2328,11 @@ my class X::TypeCheck::Splice is X::TypeCheck does X::Comp {
my class X::Assignment::RO is Exception {
has $.value = "value";
method message {
"Cannot modify an immutable {$!value.^name} ({
Rakudo::Internals.SHORT-GIST: $!value
})"
nqp::isconcrete($!value)
?? "Cannot modify an immutable {$!value.^name} ({
Rakudo::Internals.SHORT-GIST: $!value
})"
!! "Cannot modify an immutable '{$!value.^name}' type object"
}
method typename { $.value.^name }
}

0 comments on commit e675849

Please sign in to comment.
You can’t perform that action at this time.