move calling of recheck out into Resolve step
Matt S Trout [Sun, 26 Jun 2016 20:17:54 +0000 (20:17 +0000)]
lib/DX/Hypothesis.pm
lib/DX/Step/ResolveProposition.pm

index 931cd0c..202f4ea 100644 (file)
@@ -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
   );
 }
 
index c543d21..231839e 100644 (file)
@@ -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;