Skip to content

Commit

Permalink
Streamline Failure.defined/Bool a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Dec 26, 2018
1 parent 7d3b7e1 commit 2d704af
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/Failure.pm6
Expand Up @@ -52,11 +52,9 @@ my class Failure is Nil {
# TODO: should be Failure:D: multi just like method Bool,
# but obscure problems prevent us from making Mu.defined
# a multi. See http://irclog.perlgeek.de/perl6/2011-06-28#i_4016747
method defined() {
$!handled = 1 if nqp::isconcrete(self);
Bool::False;
}
multi method Bool(Failure:D:) { $!handled = 1; Bool::False; }
method defined(--> False) { $!handled = 1 if nqp::isconcrete(self) }

multi method Bool(Failure:D: --> False) { $!handled = 1 }
method handled() is rw {
Proxy.new(
FETCH => {
Expand Down

0 comments on commit 2d704af

Please sign in to comment.