move with_actions call to within with_resolution
Matt S Trout [Sun, 26 Jun 2016 17:40:24 +0000 (17:40 +0000)]
lib/DX/Hypothesis.pm
lib/DX/Step/ResolveProposition.pm

index 0386cd0..5e9a147 100644 (file)
@@ -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,
index 1a00d22..c543d21 100644 (file)
@@ -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;