diff --git a/basis/stack-checker/row-polymorphism/row-polymorphism.factor b/basis/stack-checker/row-polymorphism/row-polymorphism.factor index 76879a3950..29ee63bf33 100644 --- a/basis/stack-checker/row-polymorphism/row-polymorphism.factor +++ b/basis/stack-checker/row-polymorphism/row-polymorphism.factor @@ -37,7 +37,7 @@ IN: stack-checker.row-polymorphism [ variable vars at - ] [ variable vars set-at 0 ] if t - ] [ dup zero? ] if ; + ] [ dup 0 <= ] if ; : adjust-variable ( diff var vars -- ) pick 0 >= diff --git a/basis/stack-checker/stack-checker-tests.factor b/basis/stack-checker/stack-checker-tests.factor index e537a530d2..ce2c03264b 100644 --- a/basis/stack-checker/stack-checker-tests.factor +++ b/basis/stack-checker/stack-checker-tests.factor @@ -431,9 +431,18 @@ DEFER: eee' : strict-each ( seq quot: ( x -- ) -- ) each ; inline +: strict-map ( seq quot: ( x -- x' ) -- seq' ) + map ; inline +: strict-2map ( xs ys quot: ( x y -- z ) -- zs ) + 2map ; inline { 1 0 } [ [ drop ] strict-each ] must-infer-as +{ 1 1 } [ [ 1 + ] strict-map ] must-infer-as +{ 1 1 } [ [ ] strict-map ] must-infer-as +{ 2 1 } [ [ + ] strict-2map ] must-infer-as +{ 2 1 } [ [ drop ] strict-2map ] must-infer-as [ [ [ append ] strict-each ] infer ] [ unbalanced-branches-error? ] must-fail-with +[ [ [ 1 + ] strict-2map ] infer ] [ unbalanced-branches-error? ] must-fail-with ! ensure that polymorphic checking works on recursive combinators FROM: splitting.private => split, ;