package DX::Step::FailRecheck;

use DX::Class;

with 'DX::Role::Step';

has resume_search_state => (is => 'ro', isa => SearchState, required => 1);

has resolution_space => (is => 'ro', isa => ResolutionSpace, required => 1);

has exhaustion_depends_on => (is => 'ro', isa => DependencyList);

sub apply_to {
  my ($self, $old_ss) = @_;
  trace recheck => [ statement => [ [ symbol => 'fail_recheck' ] ] ];
  trace recheck => [ 'leave_block' ];
  return $self->resume_search_state->but(
    next_step
      => $self->resolution_space
              ->remaining_resolution_space
              ->with_geometry_dependencies($self->exhaustion_depends_on)
              ->next_step
  );
}

1;
