diff --git a/scrutinizer.scm b/scrutinizer.scm index ece07ed..07de124 100644 --- a/scrutinizer.scm +++ b/scrutinizer.scm @@ -144,11 +144,27 @@ (define-inline (value-type? t) (or (struct-type? t) (memq t value-types))) -(define (type-name x) - (let ((t (strip-syntax x))) - (if (refinement-type? t) - (sprintf "~a-~a" (string-intersperse (map conc (second t)) "/") (third t)) - (sprintf "~a" t)))) +(define (string-add-indent str #!optional (ind " ")) + (let* ([ls (string-split str "\n")] + [s (string-intersperse + (map (lambda (l) (if (string=? "" l) l + (string-append ind l))) + ls) + "\n")]) + (if (eq? #\newline (string-ref str (sub1 (string-length str)))) + (string-append s "\n") + s))) + +(define (type->pp-string t) + (string-add-indent + (string-chomp + (with-output-to-string + (lambda () + (let ([t (strip-syntax t)]) + (if (refinement-type? t) + (printf "~a-~a" (string-intersperse (map conc (second t)) "/") (third t)) + (pp t)))))) + " ")) (define specialization-statistics '()) (define trail '()) @@ -276,15 +292,14 @@ (define (always-true if-node test-node t loc) (and-let* ((_ (always-true1 t))) (report-notice - loc "~aexpected a value of type boolean in conditional, but \ - was given a value of type `~a' which is always true:~%~%~a" - (node-source-prefix test-node) t (pp-fragment if-node)) + loc "~aIn conditional~%~%~a~%~% the test expression has type~%~%~a~%~% which is always true." + (node-source-prefix test-node) (pp-fragment if-node " ") (type->pp-string t)) #t)) (define (always-false if-node test-node t loc) (and-let* ((_ (eq? t 'false))) (report-notice - loc "~ain conditional, test expression will always return false:~%~%~a" + loc "~aIn conditional, test expression will always return false:~%~%~a" (node-source-prefix test-node) (pp-fragment if-node)) #t)) @@ -315,13 +330,13 @@ (when complain (##sys#notice (conc (location-name loc) - (sprintf "~?" msg (map type-name args)))))) + (sprintf "~?" msg args))))) (define (report loc msg . args) (when complain (warning (conc (location-name loc) - (sprintf "~?" msg (map type-name args)))))) + (sprintf "~?" msg args))))) (define (report-error loc msg . args) (set! errors #t) @@ -342,11 +357,13 @@ (map (cute walk <> (add1 d)) xs))) (else (strip-syntax x)))))) - (define (pp-fragment x) - (string-chomp - (with-output-to-string - (lambda () - (pp (fragment x)))))) + (define (pp-fragment x #!optional (ind " ")) + (string-add-indent + (string-chomp + (with-output-to-string + (lambda () + (pp (fragment x))))) + ind)) (define (get-specializations name) (let* ((a (variable-mark name '##compiler#local-specializations)) @@ -355,9 +372,10 @@ (and (pair? c) c))) (define (call-result node args e loc params typeenv) - (define (pname) - (sprintf "~ain procedure call to `~s', " + (define (pname #!optional (pred "")) + (sprintf "~aProcedure call to ~a`~s' " (node-source-prefix node) + pred (fragment (first (node-subexpressions node))))) (let* ((actualtypes (map walked-result args)) (ptype (car actualtypes)) @@ -370,10 +388,10 @@ (cond ((and (not pptype?) (not (match-types xptype ptype typeenv))) (report loc - "~aexpected a value of type `~a' but was given a value of type `~a'" + "~aexpected a value of type~%~%~a~%~% but was given a value of type~%~%~a" (pname) - (resolve xptype typeenv) - (resolve ptype typeenv)) + (type->pp-string (resolve xptype typeenv)) + (type->pp-string (resolve ptype typeenv))) (values '* #f)) (else (let-values (((atypes values-rest ok alen) @@ -395,11 +413,11 @@ typeenv) (report loc - "~aexpected argument #~a of type `~a' but was given an argument of type `~a'" + "~aexpected argument #~a of type~%~%~a~%~% but was given an argument of type~%~%~a" (pname) i - (resolve (car atypes) typeenv) - (resolve (car actualtypes) typeenv)))) + (type->pp-string (resolve (car atypes) typeenv)) + (type->pp-string (resolve (car actualtypes) typeenv))))) (when (noreturn-procedure-type? ptype) (set! noreturn #t)) (let ((r (procedure-result-types ptype values-rest (cdr actualtypes) typeenv))) @@ -412,9 +430,8 @@ (cond ((match-argument-types (list pt) (cdr actualtypes) typeenv) (report-notice loc - "~athe predicate is called with an argument of type `~a' \ - and will always return true" - (pname) (cadr actualtypes)) + "~awith an argument of type~%~%~a~%~% will always return true." + (pname "predicate ") (type->pp-string (cadr actualtypes))) (when specialize (specialize-node! node (cdr args) @@ -426,9 +443,8 @@ (match-argument-types (list `(not ,pt)) (cdr actualtypes) typeenv)) (report-notice loc - "~athe predicate is called with an argument of type `~a' \ - and will always return false" - (pname) (cadr actualtypes)) + "~awith an argument of type~%~%~a~%~% will always return false." + (pname "predicate ") (type->pp-string (cadr actualtypes))) (when specialize (specialize-node! node (cdr args) @@ -663,9 +679,8 @@ (not (match-types type rt typeenv))) ((if strict report-error report) loc - "assignment of value of type `~a' to toplevel variable `~a' \ - does not match declared type `~a'" - rt var type)) + "in assignment to toplevel variable ~a, type of the value~%~%~a~%~% does not match declared type~%~%~a" + var (type->pp-string rt) (type->pp-string type))) (when (and (not type) ;XXX global declaration could allow this (not b) (not (eq? '* rt)) @@ -843,9 +858,9 @@ (not (compatible-types? t (first rt)))) ((if strict report-error report-notice) loc - "expression returns a result of type `~a' but is \ - declared to return `~a', which is not compatible" - (first rt) t)))) + "expression returns a result of type~%~%~a~%~% but is \ + declared to return~%~%~a~%~% which is not compatible." + (type->pp-string (first rt)) (type->pp-string t))))) (list t))) ((##core#typecase) (let* ((ts (walk (first subs) e loc #f #f flow ctags)) @@ -855,13 +870,11 @@ (let loop ((types (cdr params)) (subs (cdr subs))) (if (null? types) (quit-compiling - "~a~ano clause applies in `compiler-typecase' for expression of type `~a':~a" + "~a~aNo clause applies in `compiler-typecase' for expression of type~%~%~a~%~% Tested clauses were:~%~%~a" (location-name loc) (node-source-prefix n) - (type-name (car ts)) - (string-intersperse - (map (lambda (t) (sprintf "\n ~a" (type-name t))) - (cdr params)) "")) + (type->pp-string (car ts)) + (string-intersperse (map type->pp-string (cdr params)) "\n\n")) (let ((typeenv (append (type-typeenv (car types)) typeenv0))) (if (match-types (car types) (car ts) typeenv #t) (begin ; drops exp @@ -1750,17 +1763,15 @@ (let-values (((t pred pure) (validate-type new name))) (unless t (warning - (sprintf "invalid type specification for `~a': ~a" + (sprintf "Invalid type specification for `~a':~%~%~a" name - (type-name new)))) + (type->pp-string new)))) (when (and old (not (compatible-types? old t))) (warning (sprintf - "type definition for toplevel binding `~a' \ - conflicts with previously loaded type:\ - ~n New type: ~a\ - ~n Original type: ~a" - name (type-name old) (type-name new)))) + "Declared type for toplevel binding `~a'\ +~%~%~a~%~% conflicts with previously loaded type:~%~%~a" + name (type->pp-string old) (type->pp-string new)))) (mark-variable name '##compiler#type t) (mark-variable name '##compiler#type-source 'db) (when specs @@ -2163,7 +2174,7 @@ (define (report loc msg . args) (warning (conc (location-name loc) - (sprintf "~?" msg (map type-name args))))) + (sprintf "~?" msg args)))) (define (known-length-vector-index node args loc expected-argcount) (and-let* ((subs (node-subexpressions node)) @@ -2228,7 +2239,7 @@ (define (report loc msg . args) (warning (conc (location-name loc) - (sprintf "~?" msg (map type-name args))))) + (sprintf "~?" msg args)))) (define (list-or-null a) (if (null? a) 'null `(list ,@a))) @@ -2340,7 +2351,7 @@ (define (report loc msg . args) (warning (conc (location-name loc) - (sprintf "~?" msg (map type-name args))))) + (sprintf "~?" msg args)))) (define (append-special-case node args loc rtypes) (define (potentially-proper-list? l) (match-types l 'list '())) @@ -2374,12 +2385,11 @@ (unless (or (null? (cdr arg-types)) (potentially-proper-list? arg1)) (report - loc "~ain procedure call to `~a', argument #~a is \ - of type ~a but expected a proper list" + loc "~ain procedure call to `~a', argument #~a is of type~%~%~a~%~% but expected a proper list." (node-source-prefix node) (first (node-parameters (first (node-subexpressions node)))) - index arg1)) + index (type->pp-string arg1))) #f)))))) (cond ((derive-result-type) => list) (else rtypes))) diff --git a/tests/scrutiny-2.expected b/tests/scrutiny-2.expected index 9058276..5361a5b 100644 --- a/tests/scrutiny-2.expected +++ b/tests/scrutiny-2.expected @@ -1,66 +1,154 @@ Note: at toplevel: - (scrutiny-tests-2.scm:20) in procedure call to `scheme#pair?', the predicate is called with an argument of type `pair' and will always return true + (scrutiny-tests-2.scm:20) Procedure call to predicate `scheme#pair?' with an argument of type + + pair + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:20) in procedure call to `scheme#pair?', the predicate is called with an argument of type `null' and will always return false + (scrutiny-tests-2.scm:20) Procedure call to predicate `scheme#pair?' with an argument of type + + null + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:20) in procedure call to `scheme#pair?', the predicate is called with an argument of type `null' and will always return false + (scrutiny-tests-2.scm:20) Procedure call to predicate `scheme#pair?' with an argument of type + + null + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:20) in procedure call to `scheme#pair?', the predicate is called with an argument of type `fixnum' and will always return false + (scrutiny-tests-2.scm:20) Procedure call to predicate `scheme#pair?' with an argument of type + + fixnum + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:20) in procedure call to `scheme#pair?', the predicate is called with an argument of type `float' and will always return false + (scrutiny-tests-2.scm:20) Procedure call to predicate `scheme#pair?' with an argument of type + + float + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:21) in procedure call to `scheme#list?', the predicate is called with an argument of type `null' and will always return true + (scrutiny-tests-2.scm:21) Procedure call to predicate `scheme#list?' with an argument of type + + null + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:21) in procedure call to `scheme#list?', the predicate is called with an argument of type `null' and will always return true + (scrutiny-tests-2.scm:21) Procedure call to predicate `scheme#list?' with an argument of type + + null + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:21) in procedure call to `scheme#list?', the predicate is called with an argument of type `fixnum' and will always return false + (scrutiny-tests-2.scm:21) Procedure call to predicate `scheme#list?' with an argument of type + + fixnum + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:21) in procedure call to `scheme#list?', the predicate is called with an argument of type `float' and will always return false + (scrutiny-tests-2.scm:21) Procedure call to predicate `scheme#list?' with an argument of type + + float + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:22) in procedure call to `scheme#null?', the predicate is called with an argument of type `null' and will always return true + (scrutiny-tests-2.scm:22) Procedure call to predicate `scheme#null?' with an argument of type + + null + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:22) in procedure call to `scheme#null?', the predicate is called with an argument of type `null' and will always return true + (scrutiny-tests-2.scm:22) Procedure call to predicate `scheme#null?' with an argument of type + + null + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:22) in procedure call to `scheme#null?', the predicate is called with an argument of type `pair' and will always return false + (scrutiny-tests-2.scm:22) Procedure call to predicate `scheme#null?' with an argument of type + + pair + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:22) in procedure call to `scheme#null?', the predicate is called with an argument of type `fixnum' and will always return false + (scrutiny-tests-2.scm:22) Procedure call to predicate `scheme#null?' with an argument of type + + fixnum + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:22) in procedure call to `scheme#null?', the predicate is called with an argument of type `float' and will always return false + (scrutiny-tests-2.scm:22) Procedure call to predicate `scheme#null?' with an argument of type + + float + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:23) in procedure call to `chicken.base#fixnum?', the predicate is called with an argument of type `fixnum' and will always return true + (scrutiny-tests-2.scm:23) Procedure call to predicate `chicken.base#fixnum?' with an argument of type + + fixnum + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:23) in procedure call to `chicken.base#fixnum?', the predicate is called with an argument of type `float' and will always return false + (scrutiny-tests-2.scm:23) Procedure call to predicate `chicken.base#fixnum?' with an argument of type + + float + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:25) in procedure call to `chicken.base#flonum?', the predicate is called with an argument of type `float' and will always return true + (scrutiny-tests-2.scm:25) Procedure call to predicate `chicken.base#flonum?' with an argument of type + + float + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:25) in procedure call to `chicken.base#flonum?', the predicate is called with an argument of type `fixnum' and will always return false + (scrutiny-tests-2.scm:25) Procedure call to predicate `chicken.base#flonum?' with an argument of type + + fixnum + + will always return false. Note: at toplevel: - (scrutiny-tests-2.scm:27) in procedure call to `scheme#number?', the predicate is called with an argument of type `fixnum' and will always return true + (scrutiny-tests-2.scm:27) Procedure call to predicate `scheme#number?' with an argument of type + + fixnum + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:27) in procedure call to `scheme#number?', the predicate is called with an argument of type `float' and will always return true + (scrutiny-tests-2.scm:27) Procedure call to predicate `scheme#number?' with an argument of type + + float + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:27) in procedure call to `scheme#number?', the predicate is called with an argument of type `number' and will always return true + (scrutiny-tests-2.scm:27) Procedure call to predicate `scheme#number?' with an argument of type + + number + + will always return true. Note: at toplevel: - (scrutiny-tests-2.scm:27) in procedure call to `scheme#number?', the predicate is called with an argument of type `null' and will always return false + (scrutiny-tests-2.scm:27) Procedure call to predicate `scheme#number?' with an argument of type + + null + + will always return false. diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected index 44afef8..bd604ff 100644 --- a/tests/scrutiny.expected +++ b/tests/scrutiny.expected @@ -4,25 +4,43 @@ Warning: (scrutiny-tests.scm:31) - assignment to imported value binding `car' Note: in local procedure `c', in local procedure `b', in toplevel procedure `a': - expected a value of type boolean in conditional, but was given a value of type `number' which is always true: + In conditional -(if x 1 2) + (if x 1 2) + + the test expression has type + + number + + which is always true. Note: in toplevel procedure `b': - expected a value of type boolean in conditional, but was given a value of type `true' which is always true: + In conditional + + (if x 1 2) + + the test expression has type -(if x 1 2) + true + + which is always true. Warning: in toplevel procedure `foo': branches in conditional expression differ in the number of results: -(if x (scheme#values 1 2) (scheme#values 1 2 (scheme#+ (scheme#+ ...)))) + (if x (scheme#values 1 2) (scheme#values 1 2 (scheme#+ (scheme#+ ...)))) Warning: at toplevel: - (scrutiny-tests.scm:19) in procedure call to `bar', expected argument #2 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:19) Procedure call to `bar' expected argument #2 of type + + number + + but was given an argument of type + + symbol Warning: at toplevel: - (scrutiny-tests.scm:21) in procedure call to `scheme#string?', expected 1 argument but was given 0 arguments + (scrutiny-tests.scm:21) Procedure call to `scheme#string?' expected 1 argument but was given 0 arguments Warning: at toplevel: (scrutiny-tests.scm:23) expected a single result in argument #1 of procedure call `(chicken.base#print (scheme#values 1 2))', but received 2 results @@ -31,57 +49,155 @@ Warning: at toplevel: (scrutiny-tests.scm:24) expected a single result in argument #1 of procedure call `(chicken.base#print (scheme#values))', but received zero results Warning: at toplevel: - (scrutiny-tests.scm:27) in procedure call to `x', expected a value of type `(procedure () *)' but was given a value of type `fixnum' + (scrutiny-tests.scm:27) Procedure call to `x' expected a value of type + + (procedure () *) + + but was given a value of type + + fixnum Warning: at toplevel: - (scrutiny-tests.scm:29) in procedure call to `scheme#+', expected argument #1 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:29) Procedure call to `scheme#+' expected argument #1 of type + + number + + but was given an argument of type + + symbol Warning: at toplevel: - (scrutiny-tests.scm:29) in procedure call to `scheme#+', expected argument #2 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:29) Procedure call to `scheme#+' 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 `scheme#car' does not match declared type `(forall (a) (procedure scheme#car ((pair a *)) a))' + in assignment to toplevel variable scheme#car, type of the value + + fixnum + + does not match declared type + + (forall (a) (procedure scheme#car ((pair a *)) a)) Warning: at toplevel: expected a single result in `let' binding of `g19', but received 2 results Warning: at toplevel: - in procedure call to `g19', expected a value of type `(procedure () *)' but was given a value of type `fixnum' + Procedure call to `g19' expected a value of type + + (procedure () *) + + but was given a value of type + + fixnum Note: in toplevel procedure `foo': - expected a value of type boolean in conditional, but was given a value of type `(procedure bar () *)' which is always true: + In conditional + + (if bar 3 (##core#undefined)) -(if bar 3 (##core#undefined)) + the test expression has type + + (procedure bar () *) + + which is always true. Warning: in toplevel procedure `foo2': - (scrutiny-tests.scm:58) in procedure call to `scheme#string-append', expected argument #1 of type `string' but was given an argument of type `number' + (scrutiny-tests.scm:58) Procedure call to `scheme#string-append' expected argument #1 of type + + string + + but was given an argument of type + + number Warning: at toplevel: - (scrutiny-tests.scm:66) in procedure call to `foo3', expected argument #1 of type `string' but was given an argument of type `fixnum' + (scrutiny-tests.scm:66) 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:71) in procedure call to `scheme#+', expected argument #1 of type `number' but was given an argument of type `string' + (scrutiny-tests.scm:71) Procedure call to `scheme#+' expected argument #1 of type + + number + + but was given an argument of type + + string Warning: in toplevel procedure `foo5': - (scrutiny-tests.scm:77) in procedure call to `scheme#+', expected argument #1 of type `number' but was given an argument of type `string' + (scrutiny-tests.scm:77) Procedure call to `scheme#+' expected argument #1 of type + + number + + but was given an argument of type + + string Warning: in toplevel procedure `foo6': - (scrutiny-tests.scm:83) in procedure call to `scheme#+', expected argument #1 of type `number' but was given an argument of type `string' + (scrutiny-tests.scm:83) Procedure call to `scheme#+' expected argument #1 of type + + number + + but was given an argument of type + + string Warning: at toplevel: - (scrutiny-tests.scm:90) in procedure call to `scheme#+', expected argument #1 of type `number' but was given an argument of type `string' + (scrutiny-tests.scm:90) Procedure call to `scheme#+' expected argument #1 of type + + number + + but was given an argument of type + + string Warning: in toplevel procedure `foo10': - (scrutiny-tests.scm:104) in procedure call to `foo9', expected argument #1 of type `string' but was given an argument of type `number' + (scrutiny-tests.scm:104) 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:105) in procedure call to `scheme#+', expected argument #1 of type `number' but was given an argument of type `string' + (scrutiny-tests.scm:105) Procedure call to `scheme#+' 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 compatible + expression returns a result of type + + string + + but is declared to return + + pair + + which is not compatible. Warning: in toplevel procedure `foo10': - (scrutiny-tests.scm:109) in procedure call to `scheme#string-append', expected argument #1 of type `string' but was given an argument of type `pair' + (scrutiny-tests.scm:109) Procedure call to `scheme#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 @@ -90,10 +206,22 @@ 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:112) in procedure call to `scheme#*', expected argument #1 of type `number' but was given an argument of type `string' + (scrutiny-tests.scm:112) Procedure call to `scheme#*' expected argument #1 of type + + number + + but was given an argument of type + + string Warning: in toplevel procedure `foo#blabla': - (scrutiny-tests.scm:137) in procedure call to `scheme#+', expected argument #2 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:137) Procedure call to `scheme#+' expected argument #2 of type + + number + + but was given an argument of type + + symbol Warning: at toplevel: use of deprecated `deprecated-procedure' @@ -102,49 +230,119 @@ Warning: at toplevel: use of deprecated `another-deprecated-procedure' - consider `replacement-procedure' Warning: at toplevel: - (scrutiny-tests.scm:162) 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:162) 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:163) 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:163) Procedure call to `apply1' expected argument #2 of type + + (list-of number) + + but was given an argument of type + + (list symbol fixnum fixnum) Note: at toplevel: - (scrutiny-tests.scm:176) in procedure call to `chicken.base#fixnum?', the predicate is called with an argument of type `fixnum' and will always return true + (scrutiny-tests.scm:176) Procedure call to predicate `chicken.base#fixnum?' with an argument of type + + fixnum + + will always return true. Note: at toplevel: - (scrutiny-tests.scm:184) in procedure call to `scheme#symbol?', the predicate is called with an argument of type `(or char string)' and will always return false + (scrutiny-tests.scm:184) Procedure call to predicate `scheme#symbol?' with an argument of type + + (or char string) + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:185) in procedure call to `scheme#string?', the predicate is called with an argument of type `(not (or char string))' and will always return false + (scrutiny-tests.scm:185) Procedure call to predicate `scheme#string?' with an argument of type + + (not (or char string)) + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:188) in procedure call to `char-or-string?', the predicate is called with an argument of type `fixnum' and will always return false + (scrutiny-tests.scm:188) Procedure call to predicate `char-or-string?' with an argument of type + + fixnum + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:189) in procedure call to `scheme#symbol?', the predicate is called with an argument of type `(or char string)' and will always return false + (scrutiny-tests.scm:189) Procedure call to predicate `scheme#symbol?' with an argument of type + + (or char string) + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:190) in procedure call to `scheme#string?', the predicate is called with an argument of type `fixnum' and will always return false + (scrutiny-tests.scm:190) Procedure call to predicate `scheme#string?' with an argument of type + + fixnum + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:194) in procedure call to `scheme#symbol?', the predicate is called with an argument of type `char' and will always return false + (scrutiny-tests.scm:194) Procedure call to predicate `scheme#symbol?' with an argument of type + + char + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:195) in procedure call to `scheme#string?', the predicate is called with an argument of type `symbol' and will always return false + (scrutiny-tests.scm:195) Procedure call to predicate `scheme#string?' with an argument of type + + symbol + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:199) in procedure call to `scheme#symbol?', the predicate is called with an argument of type `(or char string)' and will always return false + (scrutiny-tests.scm:199) Procedure call to predicate `scheme#symbol?' with an argument of type + + (or char string) + + will always return false. Note: at toplevel: - (scrutiny-tests.scm:200) in procedure call to `scheme#string?', the predicate is called with an argument of type `symbol' and will always return false + (scrutiny-tests.scm:200) Procedure call to predicate `scheme#string?' with an argument of type + + symbol + + will always return false. Warning: at toplevel: - (scrutiny-tests.scm:204) in procedure call to `f', expected argument #1 of type `pair' but was given an argument of type `null' + (scrutiny-tests.scm:204) Procedure call to `f' expected argument #1 of type + + pair + + but was given an argument of type + + null Warning: at toplevel: - (scrutiny-tests.scm:206) in procedure call to `f', expected argument #1 of type `null' but was given an argument of type `(list fixnum)' + (scrutiny-tests.scm:206) Procedure call to `f' expected argument #1 of type + + null + + but was given an argument of type + + (list fixnum) Warning: at toplevel: - (scrutiny-tests.scm:208) in procedure call to `f', expected argument #1 of type `list' but was given an argument of type `(pair fixnum fixnum)' + (scrutiny-tests.scm:208) Procedure call to `f' expected argument #1 of type + + list + + but was given an argument of type + + (pair fixnum fixnum) Warning: in toplevel procedure `vector-ref-warn1': (scrutiny-tests.scm:214) in procedure call to `scheme#vector-ref', index -1 out of range for vector of length 3 @@ -156,7 +354,13 @@ Warning: in toplevel procedure `vector-ref-warn3': (scrutiny-tests.scm:217) in procedure call to `scheme#vector-ref', index 4 out of range for vector of length 3 Warning: in toplevel procedure `vector-ref-standard-warn1': - (scrutiny-tests.scm:220) in procedure call to `scheme#vector-ref', expected argument #2 of type `fixnum' but was given an argument of type `symbol' + (scrutiny-tests.scm:220) Procedure call to `scheme#vector-ref' expected argument #2 of type + + fixnum + + but was given an argument of type + + symbol Warning: in toplevel procedure `vector-set!-warn1': (scrutiny-tests.scm:221) in procedure call to `scheme#vector-set!', index -1 out of range for vector of length 3 @@ -168,7 +372,13 @@ Warning: in toplevel procedure `vector-set!-warn3': (scrutiny-tests.scm:223) in procedure call to `scheme#vector-set!', index 4 out of range for vector of length 3 Warning: in toplevel procedure `vector-set!-standard-warn1': - (scrutiny-tests.scm:226) in procedure call to `scheme#vector-set!', expected argument #2 of type `fixnum' but was given an argument of type `symbol' + (scrutiny-tests.scm:226) Procedure call to `scheme#vector-set!' expected argument #2 of type + + fixnum + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-warn1': (scrutiny-tests.scm:232) in procedure call to `scheme#list-ref', index -1 is negative, which is never valid @@ -186,30 +396,84 @@ Warning: in toplevel procedure `list-ref-warn5': (scrutiny-tests.scm:246) in procedure call to `scheme#list-ref', index 4 out of range for proper list of length 3 Warning: in toplevel procedure `list-ref-standard-warn1': - (scrutiny-tests.scm:275) in procedure call to `scheme#list-ref', expected argument #2 of type `fixnum' but was given an argument of type `symbol' + (scrutiny-tests.scm:275) Procedure call to `scheme#list-ref' expected argument #2 of type + + fixnum + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-standard-warn2': - (scrutiny-tests.scm:276) in procedure call to `scheme#list-ref', expected argument #2 of type `fixnum' but was given an argument of type `symbol' + (scrutiny-tests.scm:276) Procedure call to `scheme#list-ref' expected argument #2 of type + + fixnum + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-standard-warn3': - (scrutiny-tests.scm:278) in procedure call to `scheme#list-ref', expected argument #2 of type `fixnum' but was given an argument of type `symbol' + (scrutiny-tests.scm:278) Procedure call to `scheme#list-ref' expected argument #2 of type + + fixnum + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-standard-warn4': - (scrutiny-tests.scm:279) in procedure call to `scheme#list-ref', expected argument #2 of type `fixnum' but was given an argument of type `symbol' + (scrutiny-tests.scm:279) Procedure call to `scheme#list-ref' expected argument #2 of type + + fixnum + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-type-warn1': - (scrutiny-tests.scm:283) in procedure call to `chicken.base#add1', expected argument #1 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:283) Procedure call to `chicken.base#add1' expected argument #1 of type + + number + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-type-warn2': - (scrutiny-tests.scm:285) in procedure call to `chicken.base#add1', expected argument #1 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:285) Procedure call to `chicken.base#add1' expected argument #1 of type + + number + + but was given an argument of type + + symbol Warning: in toplevel procedure `list-ref-type-warn3': - (scrutiny-tests.scm:289) in procedure call to `chicken.base#add1', expected argument #1 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:289) Procedure call to `chicken.base#add1' expected argument #1 of type + + number + + but was given an argument of type + + symbol Warning: in toplevel procedure `append-result-type-warn1': - (scrutiny-tests.scm:301) in procedure call to `chicken.base#add1', expected argument #1 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:301) Procedure call to `chicken.base#add1' expected argument #1 of type + + number + + but was given an argument of type + + symbol Warning: in toplevel procedure `append-result-type-warn2': - (scrutiny-tests.scm:306) in procedure call to `chicken.base#add1', expected argument #1 of type `number' but was given an argument of type `symbol' + (scrutiny-tests.scm:306) Procedure call to `chicken.base#add1' expected argument #1 of type + + number + + but was given an argument of type + + symbol Warning: redefinition of standard binding: scheme#car diff --git a/tests/specialization.expected b/tests/specialization.expected index fed76b6..4c0d0a4 100644 --- a/tests/specialization.expected +++ b/tests/specialization.expected @@ -1,32 +1,66 @@ Note: at toplevel: - (specialization-tests.scm:3) in procedure call to `scheme#string?', the predicate is called with an argument of type `string' and will always return true + (specialization-tests.scm:3) Procedure call to predicate `scheme#string?' with an argument of type + + string + + will always return true. Note: at toplevel: - (specialization-tests.scm:3) expected a value of type boolean in conditional, but was given a value of type `true' which is always true: + (specialization-tests.scm:3) In conditional + + (if (scheme#string? a) 'ok 'no) + + the test expression has type + + true -(if (scheme#string? a) 'ok 'no) + which is always true. Note: at toplevel: - (specialization-tests.scm:4) in procedure call to `scheme#string?', the predicate is called with an argument of type `symbol' and will always return false + (specialization-tests.scm:4) Procedure call to predicate `scheme#string?' with an argument of type + + symbol + + will always return false. Note: at toplevel: - (specialization-tests.scm:4) in conditional, test expression will always return false: + (specialization-tests.scm:4) In conditional, test expression will always return false: -(if (scheme#string? a) 'ok 'no) + (if (scheme#string? a) 'ok 'no) Note: at toplevel: - (specialization-tests.scm:10) in procedure call to `scheme#input-port?', the predicate is called with an argument of type `input/output-port' and will always return true + (specialization-tests.scm:10) Procedure call to predicate `scheme#input-port?' with an argument of type + + input/output-port + + will always return true. Note: at toplevel: - (specialization-tests.scm:10) expected a value of type boolean in conditional, but was given a value of type `true' which is always true: + (specialization-tests.scm:10) In conditional -(if (scheme#input-port? p) 'ok 'no) + (if (scheme#input-port? p) 'ok 'no) + + the test expression has type + + true + + which is always true. Note: at toplevel: - (specialization-tests.scm:11) in procedure call to `scheme#output-port?', the predicate is called with an argument of type `input/output-port' and will always return true + (specialization-tests.scm:11) Procedure call to predicate `scheme#output-port?' with an argument of type + + input/output-port + + will always return true. Note: at toplevel: - (specialization-tests.scm:11) expected a value of type boolean in conditional, but was given a value of type `true' which is always true: + (specialization-tests.scm:11) In conditional + + (if (scheme#output-port? p) 'ok 'no) + + the test expression has type + + true -(if (scheme#output-port? p) 'ok 'no) + which is always true.