Skip to content
Snippets Groups Projects
Commit a06f9f7f authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Add report function for duplicate-names (fix lp bug 557306)

parent 08267f16
No related branches found
No related tags found
No related merge requests found
...@@ -735,7 +735,10 @@ actually-existing directory." ...@@ -735,7 +735,10 @@ actually-existing directory."
((components :initarg :components :reader circular-dependency-components))) ((components :initarg :components :reader circular-dependency-components)))
(define-condition duplicate-names (system-definition-error) (define-condition duplicate-names (system-definition-error)
((name :initarg :name :reader duplicate-names-name))) ((name :initarg :name :reader duplicate-names-name))
(:report (lambda (c s)
(format s "~@<Error while defining system: multiple components are given same name ~A~@:>"
(duplicate-names-name c)))))
(define-condition missing-component (system-definition-error) (define-condition missing-component (system-definition-error)
((requires :initform "(unnamed)" :reader missing-requires :initarg :requires) ((requires :initform "(unnamed)" :reader missing-requires :initarg :requires)
...@@ -1948,8 +1951,7 @@ Returns the new tree (which probably shares structure with the old one)" ...@@ -1948,8 +1951,7 @@ Returns the new tree (which probably shares structure with the old one)"
(loop :for c in (module-components ret) :do (loop :for c in (module-components ret) :do
(if (gethash (component-name c) (if (gethash (component-name c)
name-hash) name-hash)
(error 'duplicate-names (error 'duplicate-names :name (component-name c))
:name (component-name c))
(setf (gethash (component-name c) (setf (gethash (component-name c)
name-hash) name-hash)
t))))) t)))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment