X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fearly-type.lisp;h=5b761c06ab1dcd4044cd039fd13536cbf10dbfbd;hb=f066ad2b0b89c016ab9ceaac6de0758e4eb4c1fb;hp=7e419f0ab4a9f1648f4aadb105129ba733c431df;hpb=6e1c241b2cc8bd400e4622a02a8bec77d1d58878;p=sbcl.git diff --git a/src/code/early-type.lisp b/src/code/early-type.lisp index 7e419f0..5b761c0 100644 --- a/src/code/early-type.lisp +++ b/src/code/early-type.lisp @@ -34,6 +34,26 @@ (defstruct (unknown-type (:include hairy-type) (:copier nil))) +(defun maybe-reparse-specifier (type) + (when (unknown-type-p type) + (let* ((spec (unknown-type-specifier type)) + (name (if (consp spec) + (car spec) + spec))) + (when (info :type :kind name) + (let ((new-type (specifier-type spec))) + (unless (unknown-type-p new-type) + new-type)))))) + +;;; Evil macro. +(defmacro maybe-reparse-specifier! (type) + (assert (symbolp type)) + (with-unique-names (new-type) + `(let ((,new-type (maybe-reparse-specifier ,type))) + (when ,new-type + (setf ,type ,new-type) + t)))) + (defstruct (negation-type (:include ctype (class-info (type-class-or-lose 'negation)) ;; FIXME: is this right? It's @@ -527,6 +547,10 @@ (cond ((and (not (eq spec u)) (info :type :builtin spec))) + ((and (consp spec) (symbolp (car spec)) + (info :type :builtin (car spec)) + (let ((expander (info :type :expander (car spec)))) + (and expander (values-specifier-type (funcall expander spec)))))) ((eq (info :type :kind spec) :instance) (find-classoid spec)) ((typep spec 'classoid) @@ -595,6 +619,9 @@ expansion happened." (values nil nil)) ((symbolp spec) (values (info :type :expander spec) (list spec))) + ((and (consp spec) (symbolp (car spec)) (info :type :builtin (car spec))) + ;; see above + (values nil nil)) ((and (consp spec) (symbolp (car spec))) (values (info :type :expander (car spec)) spec)) (t nil))) @@ -678,8 +705,7 @@ Experimental." (defun %note-type-defined (name) (declare (symbol name)) (note-name-defined name :type) - (when (boundp 'sb!kernel::*values-specifier-type-cache-vector*) - (values-specifier-type-cache-clear)) + (values-specifier-type-cache-clear) (values))