~ chicken-core (chicken-5) 53c6da07739cbe498bfc94ad1146998d71e62568


commit 53c6da07739cbe498bfc94ad1146998d71e62568
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Wed Jun 8 08:24:59 2011 -0400
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Wed Jun 8 08:24:59 2011 -0400

    tweaked/fixed scrutinizer warning for incompatible types in 'the' forms

diff --git a/scrutinizer.scm b/scrutinizer.scm
index 76c03929..5c77b123 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -828,7 +828,7 @@
 			   (report
 			    loc
 			    (sprintf
-				"expression returns zero values but is declared to be of type `~a'"
+				"expression returns zero values but is declared to have a single result of type `~a'"
 			      t)))
 			  (else
 			   (when (> (length rt) 1)
@@ -843,7 +843,7 @@
 			      loc
 			      (sprintf
 				  "expression returns a result of type `~a', but is declared to return `~a', which is not a subtype"
-				t (first rt))))))
+				(first rt) t)))))
 		    (list t)))
 		 ((##core#switch ##core#cond)
 		  (bomb "unexpected node class" class))
diff --git a/tests/scrutiny-tests.scm b/tests/scrutiny-tests.scm
index 92557d31..dea73fe7 100644
--- a/tests/scrutiny-tests.scm
+++ b/tests/scrutiny-tests.scm
@@ -95,3 +95,10 @@
 (define (foo9 x)
   (foo8 x)
   (+ x 1))				; foo8 enforces x
+
+;; trigger warnings for incompatible types in "the" forms
+(define (foo10 x)
+  (string-append (the pair (substring x 0 10))) ; 1
+  (the * (values 1 2))				; 1 + 2
+  (the * (values))				; 3
+  (the fixnum (* x y)))				; nothing
Trap