From b8cb0cedac1390d43b17f2a5f8e28b868bdb3e38 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 25 Aug 2019 12:06:05 +0200 Subject: [PATCH 1/2] Also load "clean" and "pure" annotations from types.db when not specializing There seems to be no good reason for skipping just these two when loading types databases. All the other places that mark things as pure or clean do it unconditionally, too. --- scrutinizer.scm | 8 ++------ tests/scrutiny-2.expected | 2 +- tests/scrutiny.expected | 12 ++++++------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/scrutinizer.scm b/scrutinizer.scm index 8f5923d5..47b7c0d3 100644 --- a/scrutinizer.scm +++ b/scrutinizer.scm @@ -1587,10 +1587,6 @@ (define (load-type-database name specialize #!optional (path (repository-path))) - (define (clean! name) - (when specialize (mark-variable name '##compiler#clean #t))) - (define (pure! name) - (when specialize (mark-variable name '##compiler#pure #t))) (and-let* ((dbfile (if (not path) (and (##sys#file-exists? name #t #f #f) name) (chicken.load#find-file name path)))) @@ -1610,10 +1606,10 @@ (unless (null? props) (case (car props) ((#:pure) - (pure! name) + (mark-variable name '##compiler#pure #t) (loop (cdr props))) ((#:clean) - (clean! name) + (mark-variable name '##compiler#clean #t) (loop (cdr props))) ((#:enforce) (mark-variable name '##compiler#enforce #t) diff --git a/tests/scrutiny-2.expected b/tests/scrutiny-2.expected index 44315153..cd406985 100644 --- a/tests/scrutiny-2.expected +++ b/tests/scrutiny-2.expected @@ -16,7 +16,7 @@ Note: Predicate is always true The given argument has this type: - pair + (pair fixnum fixnum) Note: Predicate is always false In file `scrutiny-tests-2.scm:XXX', diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected index 2396a539..b93f9d23 100644 --- a/tests/scrutiny.expected +++ b/tests/scrutiny.expected @@ -76,7 +76,7 @@ Warning: Wrong number of arguments Procedure `string?' from module `scheme' has this type: - (* -> boolean) + (* --> boolean) Warning: Too many argument values In file `scrutiny-tests.scm:XXX', @@ -556,7 +556,7 @@ Warning: Invalid argument It is a call to `list' from module `scheme' which has this type: - (#!rest * -> list) + (#!rest * --> list) This is the expression: @@ -583,7 +583,7 @@ Warning: Invalid argument It is a call to `cons' from module `scheme' which has this type: - ('a 'b -> (pair 'a 'b)) + ('a 'b --> (pair 'a 'b)) This is the expression: @@ -780,7 +780,7 @@ Warning: Invalid argument It is a call to `list' from module `scheme' which has this type: - (#!rest * -> list) + (#!rest * --> list) This is the expression: @@ -807,7 +807,7 @@ Warning: Invalid argument It is a call to `list' from module `scheme' which has this type: - (#!rest * -> list) + (#!rest * --> list) This is the expression: @@ -834,7 +834,7 @@ Warning: Invalid argument It is a call to `cons' from module `scheme' which has this type: - ('a 'b -> (pair 'a 'b)) + ('a 'b --> (pair 'a 'b)) This is the expression: -- 2.20.1