0.9.1.26:
[sbcl.git] / src / compiler / proclaim.lisp
index a26b2a4..3890102 100644 (file)
 ;;; implements that by converting (FOO X Y) to (TYPE FOO X Y).
 (defun canonized-decl-spec (decl-spec)
   (let ((id (first decl-spec)))
-    (unless (symbolp id)
-      (error "The declaration identifier is not a symbol: ~S" id))
-    (let ((id-is-type (info :type :kind id))
+    (let ((id-is-type (if (symbolp id)
+                         (info :type :kind id)
+                         ;; A cons might not be a valid type specifier,
+                         ;; but it can't be a declaration either. 
+                         (or (consp id)
+                             (typep id 'class))))
          (id-is-declared-decl (info :declaration :recognized id)))
+      ;; FIXME: Checking ID-IS-DECLARED is probably useless these days,
+      ;; since we refuse to use the same symbol as both a type name and
+      ;; recognized declaration name. 
       (cond ((and id-is-type id-is-declared-decl)
             (compiler-error
              "ambiguous declaration ~S:~%  ~
         (when (constantp name)
           (error "can't declare a constant as SPECIAL: ~S" name))
         (with-single-package-locked-error
-             (:symbol name "globally declaraing ~A special"))
+             (:symbol name "globally declaring ~A special"))
         (clear-info :variable :constant-value name)
         (setf (info :variable :kind name) :special)))
       (type