From 41a77c4246c06be04a367d050da8499e1e9f20ff Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Fri, 21 Apr 2017 16:42:16 -0400 Subject: [PATCH] Fix unpretty printing of NAME-CONFLICT error Patch by cgay at google --- src/code/target-package.lisp | 4 ++-- tests/packages.impure.lisp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/code/target-package.lisp b/src/code/target-package.lisp index d48580302..bb9f2939b 100644 --- a/src/code/target-package.lisp +++ b/src/code/target-package.lisp @@ -1035,7 +1035,7 @@ implementation it is ~S." *!default-package-use-list*) (:report (lambda (c s) (format s "~@<~S ~S causes name-conflicts in ~S between the ~ - following symbols:~2I~@:_~ + following symbols: ~2I~@:_~ ~{~/sb-impl::print-symbol-with-prefix/~^, ~}~:@>" (name-conflict-function c) (name-conflict-datum c) @@ -1064,7 +1064,7 @@ implementation it is ~S." *!default-package-use-list*) (format s "Keep ~S accessible in ~A (shadowing ~S)." (old-symbol) pname datum)) (use-package - (format s "Keep symbols already accessible ~A (shadowing others)." + (format s "Keep symbols already accessible in ~A (shadowing others)." pname)))) :test use-or-export-p (dolist (s (remove-duplicates symbols :test #'string=)) diff --git a/tests/packages.impure.lisp b/tests/packages.impure.lisp index a921bfd08..f2e20af92 100644 --- a/tests/packages.impure.lisp +++ b/tests/packages.impure.lisp @@ -910,3 +910,16 @@ if a restart was invoked." (when (sb-thread:join-thread thread) (incf count))) (unintern (sb-int:keywordicate "BLUB") "KEYWORD") (assert (= count n-threads))))))) + +(with-test (:name :name-conflict-non-pretty-message) + (make-package "SILLYPACKAGE1") + (export (intern "ASILLYSYM" 'sillypackage1) 'sillypackage1) + (make-package "SILLYPACKAGE2") + (export (intern "ASILLYSYM" 'sillypackage2) 'sillypackage2) + (use-package 'sillypackage1) + (handler-case (use-package 'sillypackage2) + (name-conflict (c) ; No silly string in the result + (assert (not (search "symbols:SILLY" + (write-to-string c :pretty nil :escape nil))))) + (condition () (error "Should not get here")) + (:no-error () (error "Should not get here")))) -- 2.11.4.GIT