Infer non-callables as though they're self-evaluating
authorAlex Maestas <git@se30.xyz>
Wed, 10 Aug 2022 18:17:51 +0000 (18:17 +0000)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 10 Aug 2022 21:28:57 +0000 (14:28 -0700)
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.