BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2019-08-04

class X::Assignment::RO

Exception thrown when trying to assign to something read-only

class X::Assignment::RO is Exception {}
Code

Code like

sub f() { 42 };
f() = 'new value';  # throws an X::Assignment::RO
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Assignment::RO: Cannot modify an immutable Any␤»
Code

throws an exception of type X::Assignment::RO.

Methods§

method typename§

method typename(X::Assignment::RO:D: --> Str)
Code

Returns the type name of the value on the left-hand side