]> 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 d3d1e4e66d5e89c382f004fa2e007678d86e0488..09cdc08b256b8ada7355705a70226a3f83b9dca8 100644 (file)
@@ -9,8 +9,12 @@ 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.
     infer effect>string print ;
+
+M: callable stack-effect infer ;