From acf4040024780bd7d3bec260ff170a58cdd50854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20M=C3=A4sak?= Date: Mon, 15 May 2017 12:55:52 +0200 Subject: [PATCH] Document that Failure.handled is an lvalue Something I learned today as part of code review. Thought it might be useful in the documentation. --- doc/Type/Failure.pod6 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/Type/Failure.pod6 b/doc/Type/Failure.pod6 index dd703bf81..4e6601f8a 100644 --- a/doc/Type/Failure.pod6 +++ b/doc/Type/Failure.pod6 @@ -34,6 +34,14 @@ Returns C for handled failures, C otherwise. sub f() { fail }; my $v = f; say $v.handled; # OUTPUT: «False␤» +The C method is an lvalue, which means you can also use it to set the +handled state: + + sub f() { fail } + my $v = f; + $v.handled = True; + say $v.handled; # OUTPUT: «True␤» + =head2 method exception Defined as: