diff --git a/scrutinizer.scm b/scrutinizer.scm index 77d9de2..4e98ec2 100644 --- a/scrutinizer.scm +++ b/scrutinizer.scm @@ -208,7 +208,7 @@ ((or) (every always-true1 (cdr t))) ((forall) (always-true1 (third t))) (else #t))) - ((memq t '(* boolean true false undefined noreturn)) #f) + ((memq t '(* boolean false undefined noreturn)) #f) (else #t))) (define (always-true t loc x) diff --git a/tests/scrutiny-tests.scm b/tests/scrutiny-tests.scm index 3ac754f..14e680b 100644 --- a/tests/scrutiny-tests.scm +++ b/tests/scrutiny-tests.scm @@ -6,6 +6,12 @@ (let ((x (+ 3 4))) (if x 1 2))))) ; expected boolean but got number in conditional +(define (d) + (define (e) + (define (f) + (let ((x #t)) + (if x 1 2))))) ; #t is always true + (define (foo x) (if x ; branches return differing number of results (values 1 2) diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected index c4c21a2..2489517 100644 --- a/tests/scrutiny.expected +++ b/tests/scrutiny.expected @@ -10,13 +10,13 @@ Note: in local procedure `c', Warning: in toplevel procedure `foo': branches in conditional expression differ in the number of results: -(if x5 (values 1 2) (values 1 2 (+ (+ ...)))) +(if x9 (values 1 2) (values 1 2 (+ (+ ...)))) Warning: at toplevel: - (scrutiny-tests.scm:15) in procedure call to `bar6', expected argument #2 of type `number', but was given an argument of type `symbol' + (scrutiny-tests.scm:21) in procedure call to `bar10', expected argument #2 of type `number', but was given an argument of type `symbol' Warning: at toplevel: - (scrutiny-tests.scm:17) in procedure call to `pp', expected 1 argument, but was given 0 arguments + (scrutiny-tests.scm:23) in procedure call to `pp', expected 1 argument, but was given 0 arguments Warning: at toplevel: expected in argument #1 of procedure call `(print (cpu-time))' a single result, but were given 2 results @@ -25,58 +25,58 @@ Warning: at toplevel: expected in argument #1 of procedure call `(print (values))' a single result, but were given zero results Warning: at toplevel: - (scrutiny-tests.scm:23) in procedure call to `x7', expected a value of type `(procedure () *)', but was given a value of type `fixnum' + (scrutiny-tests.scm:29) in procedure call to `x11', expected a value of type `(procedure () *)', but was given a value of type `fixnum' Warning: at toplevel: - (scrutiny-tests.scm:25) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `symbol' + (scrutiny-tests.scm:31) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `symbol' Warning: at toplevel: - (scrutiny-tests.scm:25) in procedure call to `+', expected argument #2 of type `number', but was given an argument of type `symbol' + (scrutiny-tests.scm:31) in procedure call to `+', expected argument #2 of type `number', but was given an argument of type `symbol' Warning: at toplevel: - assignment of value of type `fixnum' to toplevel variable `car' does not match declared type `(forall (a158) (procedure car ((pair a158 *)) a158))' + assignment of value of type `fixnum' to toplevel variable `car' does not match declared type `(forall (a163) (procedure car ((pair a163 *)) a163))' Warning: at toplevel: - expected in `let' binding of `g8' a single result, but were given 2 results + expected in `let' binding of `g12' a single result, but were given 2 results Warning: at toplevel: - in procedure call to `g89', expected a value of type `(procedure () *)', but was given a value of type `fixnum' + in procedure call to `g1213', expected a value of type `(procedure () *)', but was given a value of type `fixnum' Note: in toplevel procedure `foo': expected value of type boolean in conditional but were given a value of type - `(procedure bar30 () *)' which is always true: + `(procedure bar34 () *)' which is always true: -(if bar30 3 (##core#undefined)) +(if bar34 3 (##core#undefined)) Warning: in toplevel procedure `foo2': - (scrutiny-tests.scm:54) in procedure call to `string-append', expected argument #1 of type `string', but was given an argument of type `number' + (scrutiny-tests.scm:60) in procedure call to `string-append', expected argument #1 of type `string', but was given an argument of type `number' Warning: at toplevel: - (scrutiny-tests.scm:62) in procedure call to `foo3', expected argument #1 of type `string', but was given an argument of type `fixnum' + (scrutiny-tests.scm:68) in procedure call to `foo3', expected argument #1 of type `string', but was given an argument of type `fixnum' Warning: in toplevel procedure `foo4': - (scrutiny-tests.scm:67) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' + (scrutiny-tests.scm:73) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' Warning: in toplevel procedure `foo5': - (scrutiny-tests.scm:73) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' + (scrutiny-tests.scm:79) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' Warning: in toplevel procedure `foo6': - (scrutiny-tests.scm:79) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' + (scrutiny-tests.scm:85) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' Warning: at toplevel: - (scrutiny-tests.scm:86) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' + (scrutiny-tests.scm:92) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' Warning: in toplevel procedure `foo10': - (scrutiny-tests.scm:100) in procedure call to `foo9', expected argument #1 of type `string', but was given an argument of type `number' + (scrutiny-tests.scm:106) in procedure call to `foo9', expected argument #1 of type `string', but was given an argument of type `number' Warning: in toplevel procedure `foo10': - (scrutiny-tests.scm:101) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' + (scrutiny-tests.scm:107) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `string' Note: in toplevel procedure `foo10': expression returns a result of type `string', but is declared to return `pair', which is not a subtype Warning: in toplevel procedure `foo10': - (scrutiny-tests.scm:105) in procedure call to `string-append', expected argument #1 of type `string', but was given an argument of type `pair' + (scrutiny-tests.scm:111) in procedure call to `string-append', expected argument #1 of type `string', but was given an argument of type `pair' Warning: in toplevel procedure `foo10': expression returns 2 values but is declared to have a single result @@ -88,10 +88,10 @@ Warning: in toplevel procedure `foo10': expression returns zero values but is declared to have a single result of type `*' Warning: in toplevel procedure `foo10': - (scrutiny-tests.scm:108) in procedure call to `*', expected argument #1 of type `number', but was given an argument of type `string' + (scrutiny-tests.scm:114) in procedure call to `*', expected argument #1 of type `number', but was given an argument of type `string' Warning: in toplevel procedure `foo#blabla': - (scrutiny-tests.scm:133) in procedure call to `+', expected argument #2 of type `number', but was given an argument of type `symbol' + (scrutiny-tests.scm:139) in procedure call to `+', expected argument #2 of type `number', but was given an argument of type `symbol' Warning: at toplevel: use of deprecated library procedure `deprecated-procedure' @@ -100,9 +100,9 @@ Warning: at toplevel: use of deprecated library procedure `another-deprecated-procedure' - consider using `replacement-procedure' instead Warning: at toplevel: - (scrutiny-tests.scm:158) in procedure call to `apply1', expected argument #2 of type `(list-of number)', but was given an argument of type `(list symbol fixnum fixnum)' + (scrutiny-tests.scm:164) in procedure call to `apply1', expected argument #2 of type `(list-of number)', but was given an argument of type `(list symbol fixnum fixnum)' Warning: at toplevel: - (scrutiny-tests.scm:159) in procedure call to `apply1', expected argument #2 of type `(list-of number)', but was given an argument of type `(list symbol fixnum fixnum)' + (scrutiny-tests.scm:165) in procedure call to `apply1', expected argument #2 of type `(list-of number)', but was given an argument of type `(list symbol fixnum fixnum)' Warning: redefinition of standard binding: car