From: Matt S Trout <mst@shadowcat.co.uk>
Date: Mon, 20 Jun 2016 00:49:50 +0000 (+0000)
Subject: switch next predicate to mutating searchstate instead of using alt_step
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c75a680322d940332ec3d2c0a1c9454e3447b2c4;p=scpubgit%2FDX.git

switch next predicate to mutating searchstate instead of using alt_step
---

diff --git a/lib/DX/Step/InvokeNextPredicate.pm b/lib/DX/Step/InvokeNextPredicate.pm
index 3e969e9..dc9aab1 100644
--- a/lib/DX/Step/InvokeNextPredicate.pm
+++ b/lib/DX/Step/InvokeNextPredicate.pm
@@ -9,7 +9,10 @@ has proposition => (is => 'ro', required => 1);
 sub apply_to {
   my ($self, $ss) = @_;
   my $hyp = $ss->current_hypothesis;
-  return (undef, $self->proposition->resolve_for($hyp->scope));
+  if (my $step = $self->proposition->resolve_for($hyp->scope)) {
+    return $ss->but(next_step => $step);
+  }
+  return undef;
 }
 
 1;