From: Matt S Trout Date: Sun, 26 Jun 2016 17:40:24 +0000 (+0000) Subject: move with_actions call to within with_resolution X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cdca8723930dd35811dd66240f469467bd58c994;p=scpubgit%2FDX.git move with_actions call to within with_resolution --- diff --git a/lib/DX/Hypothesis.pm b/lib/DX/Hypothesis.pm index 0386cd0..5e9a147 100644 --- a/lib/DX/Hypothesis.pm +++ b/lib/DX/Hypothesis.pm @@ -88,8 +88,10 @@ sub but_recheck_for { } sub with_resolution { - my ($self, $prop, $depends) = @_; - $self->but( + my ($self, $prop, $depends, $actions) = @_; + my $hyp = $self->with_actions(@$actions); + return undef unless $hyp; + $hyp->but( resolved_propositions => $self->resolved_propositions ->with_resolution_for( $prop, diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index 1a00d22..c543d21 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -56,8 +56,9 @@ sub apply_to { sub _apply_to_hyp { my ($self, $old_hyp) = @_; - return undef unless my $hyp = $old_hyp->with_actions(@{$self->actions}); - return $hyp->with_resolution($self->resolves, $self->depends_on); + return $old_hyp->with_resolution( + $self->resolves, $self->depends_on, $self->actions + ); } 1;