~ chicken-core (chicken-5) 1082e8998759ee2b3f8b47ff5b2d24be91c58a5e
commit 1082e8998759ee2b3f8b47ff5b2d24be91c58a5e
Author: Evan Hanson <evhan@foldling.org>
AuthorDate: Mon Feb 15 22:15:42 2016 +1300
Commit: Peter Bex <peter@more-magic.net>
CommitDate: Sat Jun 18 16:31:45 2016 +0200
Propagate known predicate call result types
Previously, predicate calls would specialize but not communicate the
true or false result type to the caller, who would re-walk the node but
still use the original, more general type (probably "boolean").
Signed-off-by: Peter Bex <peter@more-magic.net>
diff --git a/scrutinizer.scm b/scrutinizer.scm
index 2221cf98..f03b51eb 100644
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -369,6 +369,7 @@
(specialize-node!
node (cdr args)
`(let ((#(tmp) #(1))) '#t))
+ (set! r '(true))
(set! op (list pn pt))))
((begin
(trail-restore trail0 typeenv)
@@ -382,6 +383,7 @@
(specialize-node!
node (cdr args)
`(let ((#(tmp) #(1))) '#f))
+ (set! r '(false))
(set! op (list pt `(not ,pt)))))
(else (trail-restore trail0 typeenv)))))
((and specialize (get-specializations pn)) =>
Trap