move remaining resolution_space selection into FailRecheck
Matt S Trout [Mon, 16 Apr 2018 02:08:49 +0000 (02:08 +0000)]
lib/DX/Step/EnterRecheck.pm
lib/DX/Step/FailRecheck.pm
lib/DX/Step/ResolveProposition.pm

index ba9d125..95088ce 100644 (file)
@@ -13,7 +13,7 @@ has proposition_list => (
 
 has on_completion_step => (is => 'ro', isa => Step, required => 1);
 
-has on_failure_step => (is => 'ro', isa => Maybe[Step], required => 1);
+has resolution_space => (is => 'ro', isa => ResolutionSpace, required => 1);
 
 sub apply_to {
   my ($self, $old_ss) = @_;
@@ -69,7 +69,8 @@ sub apply_to {
       was_recheck_for => $prop,
     ),
     on_exhaustion_step => DX::Step::FailRecheck->new(
-      resume_search_state => $old_ss->but(next_step => $self->on_failure_step),
+      resume_search_state => $old_ss,
+      resolution_space => $self->resolution_space,
     ),
   );
 
index 82ab5db..d4d3d94 100644 (file)
@@ -6,11 +6,16 @@ with 'DX::Role::Step';
 
 has resume_search_state => (is => 'ro', isa => SearchState, required => 1);
 
+has resolution_space => (is => 'ro', isa => ResolutionSpace, required => 1);
+
 sub apply_to {
   my ($self, $old_ss) = @_;
   trace recheck => [ statement => [ [ symbol => 'fail_recheck' ] ] ];
   trace recheck => [ 'leave_block' ];
-  return $self->resume_search_state;
+  return $self->resume_search_state->but(
+    next_step
+      => $self->resolution_space->remaining_resolution_space->next_step
+  );
 }
 
 1;
index c714458..150ddc2 100644 (file)
@@ -69,7 +69,7 @@ sub apply_to {
     next_step => DX::Step::EnterRecheck->new(
       proposition_list => \@recheck,
       on_completion_step => $ss->next_step,
-      on_failure_step => $rspace->remaining_resolution_space->next_step,
+      resolution_space => $rspace,
     ),
   );
 }