]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/stack-checker/stack-checker.factor
Infer non-callables as though they're self-evaluating
[factor.git] / basis / stack-checker / stack-checker.factor
index 3dc9f198ca1155d5983a72eeb3fabe4a1c163d77..09cdc08b256b8ada7355705a70226a3f83b9dca8 100644 (file)
@@ -9,7 +9,9 @@ stack-checker.visitor.dummy ;
 IN: stack-checker
 
 : infer ( quot -- effect )
-    [ infer-quot-here ] with-infer drop ;
+    dup callable?
+    [ [ infer-quot-here ] with-infer drop ]
+    [ drop ( -- x ) ] if ;
 
 : infer. ( quot -- )
     ! Safe to call from inference transforms.