X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Ftypetran.lisp;h=acaac05e57c5651da83ce626d3a8f3f6b18f09b6;hb=d2e48d5a1805e3fb98268473a71aff38d8fd9d0b;hp=a63f23afcc181014aeb077716d3cc2b2de524825;hpb=cae594ffb04c80cfa70abce4a6a35a9ba5a27e8c;p=sbcl.git diff --git a/src/compiler/typetran.lisp b/src/compiler/typetran.lisp index a63f23a..acaac05 100644 --- a/src/compiler/typetran.lisp +++ b/src/compiler/typetran.lisp @@ -276,6 +276,11 @@ `(typep ,n-obj ',x)) (rest spec)))))))))) +(defun source-transform-negation-typep (object type) + (declare (type negation-type type)) + (let ((spec (type-specifier (negation-type-type type)))) + `(not (typep ,object ',spec)))) + ;;; Do source transformation for TYPEP of a known union type. If a ;;; union type contains LIST, then we pull that out and make it into a ;;; single LISTP call. Note that if SYMBOL is in the union, then LIST @@ -505,6 +510,8 @@ (typecase type (hairy-type (source-transform-hairy-typep object type)) + (negation-type + (source-transform-negation-typep object type)) (union-type (source-transform-union-typep object type)) (intersection-type