From: Matt S Trout Date: Mon, 16 Apr 2018 02:08:49 +0000 (+0000) Subject: move remaining resolution_space selection into FailRecheck X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=54da7534d82bd0625a5cc4887ec7819e68324b39;p=scpubgit%2FDX.git move remaining resolution_space selection into FailRecheck --- diff --git a/lib/DX/Step/EnterRecheck.pm b/lib/DX/Step/EnterRecheck.pm index ba9d125..95088ce 100644 --- a/lib/DX/Step/EnterRecheck.pm +++ b/lib/DX/Step/EnterRecheck.pm @@ -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, ), ); diff --git a/lib/DX/Step/FailRecheck.pm b/lib/DX/Step/FailRecheck.pm index 82ab5db..d4d3d94 100644 --- a/lib/DX/Step/FailRecheck.pm +++ b/lib/DX/Step/FailRecheck.pm @@ -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; diff --git a/lib/DX/Step/ResolveProposition.pm b/lib/DX/Step/ResolveProposition.pm index c714458..150ddc2 100644 --- a/lib/DX/Step/ResolveProposition.pm +++ b/lib/DX/Step/ResolveProposition.pm @@ -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, ), ); }