From: Matt S Trout Date: Sun, 26 Jun 2016 20:17:54 +0000 (+0000) Subject: move calling of recheck out into Resolve step X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FDX.git;a=commitdiff_plain;h=77065529a9faee7f2865ac34793f7716f4b9827f move calling of recheck out into Resolve step --- diff --git a/lib/DX/Hypothesis.pm b/lib/DX/Hypothesis.pm index 931cd0c..202f4ea 100644 --- a/lib/DX/Hypothesis.pm +++ b/lib/DX/Hypothesis.pm @@ -92,16 +92,15 @@ sub with_resolution { my ($self, $prop, $depends, $actions) = @_; (my $hyp, my @recheck) = $self->with_actions(@$actions); return undef unless $hyp; - if (@recheck) { - $hyp = $hyp->but_recheck_for(@recheck); - return undef unless $hyp; - } - $hyp->but( - resolved_propositions => $self->resolved_propositions - ->with_resolution_for( - $prop, - $depends, - ), + return ( + $hyp->but( + resolved_propositions => $self->resolved_propositions + ->with_resolution_for( + $prop, + $depends, + ), + ), + @recheck ); } diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index c543d21..231839e 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -56,9 +56,14 @@ sub apply_to { sub _apply_to_hyp { my ($self, $old_hyp) = @_; - return $old_hyp->with_resolution( + (my $hyp, my @recheck) = $old_hyp->with_resolution( $self->resolves, $self->depends_on, $self->actions ); + return undef unless $hyp; + if (@recheck) { + $hyp = $hyp->but_recheck_for(@recheck); + } + return $hyp; } 1;