create explicit on_exhaustion_step attribute
[scpubgit/DX.git] / lib / DX / Step / Backtrack.pm
index 8e3b5d8..3306fc3 100644 (file)
@@ -7,7 +7,7 @@ with 'DX::Role::Step';
 sub apply_to {
   my ($self, $ss) = @_;
   my ($first_alt, @rest_alt) = @{$ss->alternatives};
-  return $ss->but(next_step => undef) unless $first_alt;
+  return $ss->but(next_step => $ss->on_exhaustion_step) unless $first_alt;
   trace 'search.backtrack.rewind_to' => $first_alt->[1];
   return $ss->but(
     current_hypothesis => $first_alt->[0],