~ chicken-core (chicken-5) 3caaf71f49b97aecf8c84e358de973350f4bac7c


commit 3caaf71f49b97aecf8c84e358de973350f4bac7c
Author:     megane <meganeka@gmail.com>
AuthorDate: Mon Nov 19 11:55:01 2018 +0200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Sat Mar 9 20:29:00 2019 +1300

    Print variable name and its module separately in scrutinizer messages
    
    It's faster to visually parse `foo' from `bar' than `bar#foo'.
    
    Signed-off-by: Evan Hanson <evhan@foldling.org>

diff --git a/scrutinizer.scm b/scrutinizer.scm
index c4bb70b5..6b96429e 100644
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -2468,6 +2468,12 @@
 	    (rec (cdr loc)
 		 (cons (sprintf "In `~a', a local procedure" (lname (car loc))) msgs))))))
 
+(define (variable-from-module sym)
+  (let ((r (string-split (symbol->string sym) "#" #t)))
+    (if (= (length r) 2)
+	(sprintf "`~a', imported from `~a'," (second r) (first r))
+	(sprintf "`~a'" sym))))
+
 (define (report2 report-f location-node-candidates loc msg . args)
   (define (file-location)
     (any (lambda (n) (and (not (string=? "" (node-source-prefix n)))
@@ -2520,13 +2526,14 @@
     "~%~%"
     "Procedure `~a' is called with ~a argument~a but ~a argument~a is expected."
     "~%~%"
-    "The procedure's type is"
+    "Procedure ~a has type"
     "~%~%"
     "~a")
    (pp-fragment node)
-   pname
+   (strip-namespace pname)
    argc (multiples argc)
    exp-count (multiples exp-count)
+   (variable-from-module pname)
    (type->pp-string ptype)))
 
 (define (r-proc-call-argument-type-mismatch loc node pname i xptype atype ptype)
@@ -2547,14 +2554,15 @@
     "~%~%"
     "~a"
     "~%~%"
-    "The procedure's type is"
+    "Procedure ~a has type"
     "~%~%"
     "~a")
    (pp-fragment node)
    i
-   pname
+   (strip-namespace pname)
    (type->pp-string atype)
    (type->pp-string xptype)
+   (variable-from-module pname)
    (type->pp-string ptype)))
 
 (define (r-pred-call-always-true loc node pname pred-type atype)
@@ -2569,7 +2577,7 @@
     "~%~%"
     "Predicate call will always return true."
     "~%~%"
-    "Procedure `~a' is a predicate for"
+    "Procedure ~a is a predicate for"
     "~%~%"
     "~a"
     "~%~%"
@@ -2577,7 +2585,7 @@
     "~%~%"
     "~a")
    (pp-fragment node)
-   pname
+   (variable-from-module pname)
    (type->pp-string pred-type)
    (type->pp-string atype)))
 
@@ -2592,7 +2600,7 @@
     "~%~%"
     "Predicate call will always return false."
     "~%~%"
-    "Procedure `~a' is a predicate for"
+    "Procedure ~a is a predicate for"
     "~%~%"
     "~a"
     "~%~%"
@@ -2600,7 +2608,7 @@
     "~%~%"
     "~a")
    (pp-fragment node)
-   pname
+   (variable-from-module pname)
    (type->pp-string pred-type)
    (type->pp-string atype)))
 
@@ -2703,7 +2711,7 @@
     "~%~%"
     "  Tested expression in `compiler-typecase' does not match any case."
     "~%~%"
-    "  The expression has this type"
+    "  The expression has type"
     "~%~%"
     "~a"
     "~%~%"
diff --git a/tests/scrutinizer-message-format.expected b/tests/scrutinizer-message-format.expected
index 986c2b16..992aa4e1 100644
--- a/tests/scrutinizer-message-format.expected
+++ b/tests/scrutinizer-message-format.expected
@@ -11,9 +11,9 @@ Warning: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
     (scheme#cons '())
 
-  Procedure `scheme#cons' is called with 1 argument but 2 arguments is expected.
+  Procedure `cons' is called with 1 argument but 2 arguments is expected.
 
-  The procedure's type is
+  Procedure `cons', imported from `scheme', has type
 
     (forall (aXXX bXXX) (procedure scheme#cons (aXXX bXXX) (pair aXXX bXXX)))
 
@@ -23,7 +23,7 @@ Warning: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
     (scheme#length 'symbol)
 
-  Argument #1 to procedure `scheme#length' has invalid type
+  Argument #1 to procedure `length' has invalid type
 
     symbol
 
@@ -31,7 +31,7 @@ Warning: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
     list
 
-  The procedure's type is
+  Procedure `length', imported from `scheme', has type
 
     (procedure scheme#length (list) fixnum)
 
@@ -82,7 +82,7 @@ Note: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#list?' is a predicate for
+  Procedure `list?', imported from `scheme', is a predicate for
 
     list
 
@@ -98,7 +98,7 @@ Note: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#symbol?' is a predicate for
+  Procedure `symbol?', imported from `scheme', is a predicate for
 
     symbol
 
@@ -255,9 +255,9 @@ Warning: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
     (scheme#cons '())
 
-  Procedure `scheme#cons' is called with 1 argument but 2 arguments is expected.
+  Procedure `cons' is called with 1 argument but 2 arguments is expected.
 
-  The procedure's type is
+  Procedure `cons', imported from `scheme', has type
 
     (forall (aXXX bXXX) (procedure scheme#cons (aXXX bXXX) (pair aXXX bXXX)))
 
@@ -269,7 +269,7 @@ Warning: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
     (scheme#length 'symbol)
 
-  Argument #1 to procedure `scheme#length' has invalid type
+  Argument #1 to procedure `length' has invalid type
 
     symbol
 
@@ -277,7 +277,7 @@ Warning: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
     list
 
-  The procedure's type is
+  Procedure `length', imported from `scheme', has type
 
     (procedure scheme#length (list) fixnum)
 
@@ -340,7 +340,7 @@ Note: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#list?' is a predicate for
+  Procedure `list?', imported from `scheme', is a predicate for
 
     list
 
@@ -358,7 +358,7 @@ Note: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#symbol?' is a predicate for
+  Procedure `symbol?', imported from `scheme', is a predicate for
 
     symbol
 
@@ -535,7 +535,7 @@ Error: Type mismatch (test-scrutinizer-message-format.scm:XXX)
 
   Tested expression in `compiler-typecase' does not match any case.
 
-  The expression has this type
+  The expression has type
 
     fixnum
 
diff --git a/tests/scrutiny-2.expected b/tests/scrutiny-2.expected
index 58f98619..42973f87 100644
--- a/tests/scrutiny-2.expected
+++ b/tests/scrutiny-2.expected
@@ -9,7 +9,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#pair?' is a predicate for
+  Procedure `pair?', imported from `scheme', is a predicate for
 
     pair
 
@@ -25,7 +25,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#pair?' is a predicate for
+  Procedure `pair?', imported from `scheme', is a predicate for
 
     pair
 
@@ -41,7 +41,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#pair?' is a predicate for
+  Procedure `pair?', imported from `scheme', is a predicate for
 
     pair
 
@@ -57,7 +57,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#pair?' is a predicate for
+  Procedure `pair?', imported from `scheme', is a predicate for
 
     pair
 
@@ -73,7 +73,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#pair?' is a predicate for
+  Procedure `pair?', imported from `scheme', is a predicate for
 
     pair
 
@@ -89,7 +89,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#list?' is a predicate for
+  Procedure `list?', imported from `scheme', is a predicate for
 
     list
 
@@ -105,7 +105,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#list?' is a predicate for
+  Procedure `list?', imported from `scheme', is a predicate for
 
     list
 
@@ -121,7 +121,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#list?' is a predicate for
+  Procedure `list?', imported from `scheme', is a predicate for
 
     list
 
@@ -137,7 +137,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#list?' is a predicate for
+  Procedure `list?', imported from `scheme', is a predicate for
 
     list
 
@@ -153,7 +153,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#null?' is a predicate for
+  Procedure `null?', imported from `scheme', is a predicate for
 
     null
 
@@ -169,7 +169,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#null?' is a predicate for
+  Procedure `null?', imported from `scheme', is a predicate for
 
     null
 
@@ -185,7 +185,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#null?' is a predicate for
+  Procedure `null?', imported from `scheme', is a predicate for
 
     null
 
@@ -201,7 +201,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#null?' is a predicate for
+  Procedure `null?', imported from `scheme', is a predicate for
 
     null
 
@@ -217,7 +217,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#null?' is a predicate for
+  Procedure `null?', imported from `scheme', is a predicate for
 
     null
 
@@ -233,7 +233,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `chicken.base#fixnum?' is a predicate for
+  Procedure `fixnum?', imported from `chicken.base', is a predicate for
 
     fixnum
 
@@ -249,7 +249,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `chicken.base#fixnum?' is a predicate for
+  Procedure `fixnum?', imported from `chicken.base', is a predicate for
 
     fixnum
 
@@ -265,7 +265,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `chicken.base#flonum?' is a predicate for
+  Procedure `flonum?', imported from `chicken.base', is a predicate for
 
     float
 
@@ -281,7 +281,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `chicken.base#flonum?' is a predicate for
+  Procedure `flonum?', imported from `chicken.base', is a predicate for
 
     float
 
@@ -297,7 +297,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#number?' is a predicate for
+  Procedure `number?', imported from `scheme', is a predicate for
 
     number
 
@@ -313,7 +313,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#number?' is a predicate for
+  Procedure `number?', imported from `scheme', is a predicate for
 
     number
 
@@ -329,7 +329,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#number?' is a predicate for
+  Procedure `number?', imported from `scheme', is a predicate for
 
     number
 
@@ -345,7 +345,7 @@ Note: Type mismatch (scrutiny-tests-2.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#number?' is a predicate for
+  Procedure `number?', imported from `scheme', is a predicate for
 
     number
 
diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected
index 1b3f55fa..2ac59afa 100644
--- a/tests/scrutiny.expected
+++ b/tests/scrutiny.expected
@@ -55,7 +55,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `bar' has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -65,9 +65,9 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#string?)
 
-  Procedure `scheme#string?' is called with 0 arguments but 1 argument is expected.
+  Procedure `string?' is called with 0 arguments but 1 argument is expected.
 
-  The procedure's type is
+  Procedure `string?', imported from `scheme', has type
 
     (procedure scheme#string? (*) boolean)
 
@@ -97,7 +97,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ 'a 'b)
 
-  Argument #1 to procedure `scheme#+' has invalid type
+  Argument #1 to procedure `+' has invalid type
 
     symbol
 
@@ -105,7 +105,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -115,7 +115,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ 'a 'b)
 
-  Argument #2 to procedure `scheme#+' has invalid type
+  Argument #2 to procedure `+' has invalid type
 
     symbol
 
@@ -123,7 +123,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -176,7 +176,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#string-append x "abc")
 
-  Argument #1 to procedure `scheme#string-append' has invalid type
+  Argument #1 to procedure `string-append' has invalid type
 
     number
 
@@ -184,7 +184,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     string
 
-  The procedure's type is
+  Procedure `string-append', imported from `scheme', has type
 
     (procedure scheme#string-append (#!rest string) string)
 
@@ -202,7 +202,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     string
 
-  The procedure's type is
+  Procedure `foo3' has type
 
     (procedure foo3 (string) string)
 
@@ -212,7 +212,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ x 1)
 
-  Argument #1 to procedure `scheme#+' has invalid type
+  Argument #1 to procedure `+' has invalid type
 
     string
 
@@ -220,7 +220,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -230,7 +230,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ x 3)
 
-  Argument #1 to procedure `scheme#+' has invalid type
+  Argument #1 to procedure `+' has invalid type
 
     string
 
@@ -238,7 +238,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -248,7 +248,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ x 3)
 
-  Argument #1 to procedure `scheme#+' has invalid type
+  Argument #1 to procedure `+' has invalid type
 
     string
 
@@ -256,7 +256,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -266,7 +266,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ x 1)
 
-  Argument #1 to procedure `scheme#+' has invalid type
+  Argument #1 to procedure `+' has invalid type
 
     string
 
@@ -274,7 +274,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -292,7 +292,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     string
 
-  The procedure's type is
+  Procedure `foo9' has type
 
     (procedure foo9 (string) symbol)
 
@@ -302,7 +302,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ x 1)
 
-  Argument #1 to procedure `scheme#+' has invalid type
+  Argument #1 to procedure `+' has invalid type
 
     string
 
@@ -310,7 +310,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -336,7 +336,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#string-append (the pair (scheme#substring x 0 10)))
 
-  Argument #1 to procedure `scheme#string-append' has invalid type
+  Argument #1 to procedure `string-append' has invalid type
 
     pair
 
@@ -344,7 +344,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     string
 
-  The procedure's type is
+  Procedure `string-append', imported from `scheme', has type
 
     (procedure scheme#string-append (#!rest string) string)
 
@@ -376,7 +376,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#* x y)
 
-  Argument #1 to procedure `scheme#*' has invalid type
+  Argument #1 to procedure `*' has invalid type
 
     string
 
@@ -384,7 +384,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `*', imported from `scheme', has type
 
     (procedure scheme#* (#!rest number) number)
 
@@ -394,7 +394,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#+ 1 'x)
 
-  Argument #2 to procedure `scheme#+' has invalid type
+  Argument #2 to procedure `+' has invalid type
 
     symbol
 
@@ -402,7 +402,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `+', imported from `scheme', has type
 
     (procedure scheme#+ (#!rest number) number)
 
@@ -426,7 +426,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (list-of number)
 
-  The procedure's type is
+  Procedure `apply1' has type
 
     (forall
       (a143 b144)
@@ -446,7 +446,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (list-of number)
 
-  The procedure's type is
+  Procedure `apply1' has type
 
     (forall
       (a143 b144)
@@ -460,7 +460,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `chicken.base#fixnum?' is a predicate for
+  Procedure `fixnum?', imported from `chicken.base', is a predicate for
 
     fixnum
 
@@ -476,7 +476,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#symbol?' is a predicate for
+  Procedure `symbol?', imported from `scheme', is a predicate for
 
     symbol
 
@@ -492,7 +492,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#string?' is a predicate for
+  Procedure `string?', imported from `scheme', is a predicate for
 
     string
 
@@ -524,7 +524,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#symbol?' is a predicate for
+  Procedure `symbol?', imported from `scheme', is a predicate for
 
     symbol
 
@@ -540,7 +540,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#string?' is a predicate for
+  Procedure `string?', imported from `scheme', is a predicate for
 
     string
 
@@ -556,7 +556,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#symbol?' is a predicate for
+  Procedure `symbol?', imported from `scheme', is a predicate for
 
     symbol
 
@@ -572,7 +572,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#string?' is a predicate for
+  Procedure `string?', imported from `scheme', is a predicate for
 
     string
 
@@ -588,7 +588,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#symbol?' is a predicate for
+  Procedure `symbol?', imported from `scheme', is a predicate for
 
     symbol
 
@@ -604,7 +604,7 @@ Note: Type mismatch (scrutiny-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#string?' is a predicate for
+  Procedure `string?', imported from `scheme', is a predicate for
 
     string
 
@@ -626,7 +626,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     pair
 
-  The procedure's type is
+  Procedure `f' has type
 
     (procedure (pair) *)
 
@@ -644,7 +644,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     null
 
-  The procedure's type is
+  Procedure `f' has type
 
     (procedure (null) *)
 
@@ -662,7 +662,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     list
 
-  The procedure's type is
+  Procedure `f' has type
 
     (procedure (list) *)
 
@@ -681,7 +681,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#vector-ref v1 'bad)
 
-  Argument #2 to procedure `scheme#vector-ref' has invalid type
+  Argument #2 to procedure `vector-ref' has invalid type
 
     symbol
 
@@ -689,7 +689,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     fixnum
 
-  The procedure's type is
+  Procedure `vector-ref', imported from `scheme', has type
 
     (forall (a384) (procedure scheme#vector-ref ((vector-of a384) fixnum) a384))
 
@@ -708,7 +708,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#vector-set! v1 'bad 'whatever)
 
-  Argument #2 to procedure `scheme#vector-set!' has invalid type
+  Argument #2 to procedure `vector-set!' has invalid type
 
     symbol
 
@@ -716,7 +716,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     fixnum
 
-  The procedure's type is
+  Procedure `vector-set!', imported from `scheme', has type
 
     (procedure scheme#vector-set! (vector fixnum *) undefined)
 
@@ -741,7 +741,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#list-ref l1 'bad)
 
-  Argument #2 to procedure `scheme#list-ref' has invalid type
+  Argument #2 to procedure `list-ref' has invalid type
 
     symbol
 
@@ -749,7 +749,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     fixnum
 
-  The procedure's type is
+  Procedure `list-ref', imported from `scheme', has type
 
     (forall (a366) (procedure scheme#list-ref ((list-of a366) fixnum) a366))
 
@@ -759,7 +759,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#list-ref l1 'bad)
 
-  Argument #2 to procedure `scheme#list-ref' has invalid type
+  Argument #2 to procedure `list-ref' has invalid type
 
     symbol
 
@@ -767,7 +767,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     fixnum
 
-  The procedure's type is
+  Procedure `list-ref', imported from `scheme', has type
 
     (forall (a366) (procedure scheme#list-ref ((list-of a366) fixnum) a366))
 
@@ -777,7 +777,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#list-ref l2 'bad)
 
-  Argument #2 to procedure `scheme#list-ref' has invalid type
+  Argument #2 to procedure `list-ref' has invalid type
 
     symbol
 
@@ -785,7 +785,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     fixnum
 
-  The procedure's type is
+  Procedure `list-ref', imported from `scheme', has type
 
     (forall (a366) (procedure scheme#list-ref ((list-of a366) fixnum) a366))
 
@@ -795,7 +795,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (scheme#list-ref l2 'bad)
 
-  Argument #2 to procedure `scheme#list-ref' has invalid type
+  Argument #2 to procedure `list-ref' has invalid type
 
     symbol
 
@@ -803,7 +803,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     fixnum
 
-  The procedure's type is
+  Procedure `list-ref', imported from `scheme', has type
 
     (forall (a366) (procedure scheme#list-ref ((list-of a366) fixnum) a366))
 
@@ -813,7 +813,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (chicken.base#add1 (scheme#list-ref l1 1))
 
-  Argument #1 to procedure `chicken.base#add1' has invalid type
+  Argument #1 to procedure `add1' has invalid type
 
     symbol
 
@@ -821,7 +821,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `add1', imported from `chicken.base', has type
 
     (procedure chicken.base#add1 (number) number)
 
@@ -831,7 +831,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (chicken.base#add1 (scheme#list-ref l2 1))
 
-  Argument #1 to procedure `chicken.base#add1' has invalid type
+  Argument #1 to procedure `add1' has invalid type
 
     symbol
 
@@ -839,7 +839,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `add1', imported from `chicken.base', has type
 
     (procedure chicken.base#add1 (number) number)
 
@@ -849,7 +849,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (chicken.base#add1 (scheme#list-ref l3 1))
 
-  Argument #1 to procedure `chicken.base#add1' has invalid type
+  Argument #1 to procedure `add1' has invalid type
 
     symbol
 
@@ -857,7 +857,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `add1', imported from `chicken.base', has type
 
     (procedure chicken.base#add1 (number) number)
 
@@ -867,7 +867,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (chicken.base#add1 (scheme#list-ref l1 1))
 
-  Argument #1 to procedure `chicken.base#add1' has invalid type
+  Argument #1 to procedure `add1' has invalid type
 
     symbol
 
@@ -875,7 +875,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `add1', imported from `chicken.base', has type
 
     (procedure chicken.base#add1 (number) number)
 
@@ -885,7 +885,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     (chicken.base#add1 (scheme#list-ref l3 3))
 
-  Argument #1 to procedure `chicken.base#add1' has invalid type
+  Argument #1 to procedure `add1' has invalid type
 
     symbol
 
@@ -893,7 +893,7 @@ Warning: Type mismatch (scrutiny-tests.scm:XXX)
 
     number
 
-  The procedure's type is
+  Procedure `add1', imported from `chicken.base', has type
 
     (procedure chicken.base#add1 (number) number)
 
diff --git a/tests/specialization.expected b/tests/specialization.expected
index 6f8fe43a..40e7d61e 100644
--- a/tests/specialization.expected
+++ b/tests/specialization.expected
@@ -9,7 +9,7 @@ Note: Type mismatch (specialization-tests.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#string?' is a predicate for
+  Procedure `string?', imported from `scheme', is a predicate for
 
     string
 
@@ -35,7 +35,7 @@ Note: Type mismatch (specialization-tests.scm:XXX)
 
   Predicate call will always return false.
 
-  Procedure `scheme#string?' is a predicate for
+  Procedure `string?', imported from `scheme', is a predicate for
 
     string
 
@@ -59,7 +59,7 @@ Note: Type mismatch (specialization-tests.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#input-port?' is a predicate for
+  Procedure `input-port?', imported from `scheme', is a predicate for
 
     input-port
 
@@ -85,7 +85,7 @@ Note: Type mismatch (specialization-tests.scm:XXX)
 
   Predicate call will always return true.
 
-  Procedure `scheme#output-port?' is a predicate for
+  Procedure `output-port?', imported from `scheme', is a predicate for
 
     output-port
 
Trap