Ignore:
Timestamp:
Aug 1, 2009, 3:50:08 PM (10 years ago)
Author:
gz
Message:

ftypes - r12467/r12500/r12512/r12514 from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/nx-basic.lisp

    r12412 r12515  
    205205(%include "ccl:compiler;lambda-list.lisp")
    206206
    207 
     207#-BOOTSTRAPPED (unless (fboundp 'types-disjoint-p)
     208                 (fset 'types-disjoint-p (lambda (t1 t2 &optional env) t1 t2 env nil)))
    208209
    209210
     
    352353                     (assq sym *nx-proclaimed-types*))))
    353354    (if decl (%cdr decl) t)))
     355
     356(defun nx-declared-result-type (sym &optional (env *nx-lexical-environment*))
     357  (when (symbolp (setq sym (maybe-setf-function-name sym)))
     358    (let* ((ftype (find-ftype-decl sym env))
     359           (ctype (if (typep ftype 'ctype) ftype (specifier-type-if-known ftype env))))
     360      (unless (or (null ctype)
     361                  (not (function-ctype-p ctype))
     362                  (eq *wild-type* (function-ctype-returns ctype)))
     363        (let ((result-type (type-specifier (single-value-type (function-ctype-returns ctype)))))
     364          (and (neq result-type 't) result-type))))))
    354365
    355366(defmacro define-declaration (decl-name lambda-list &body body &environment env)
     
    598609       (destructuring-bind (badguy goodguys)
    599610           (cdr reason)
    600          (format stream "the keyword argument ~s is not one of ~s, which are recognized~&  by " badguy goodguys))))
     611         (format stream "the keyword argument~:[ ~s is~;s~{ ~s~^~#[~; and~:;,~]~} are~] not one of ~s, which are recognized~&  by "
     612                 (consp badguy) badguy goodguys))))
    601613    (format stream
    602614            (ecase (compiler-warning-warning-type condition)       
     615              (:ftype-mismatch "the FTYPE declaration of ~s")
    603616              (:global-mismatch "the current global definition of ~s")
    604617              (:environment-mismatch "the definition of ~s visible in the current compilation unit.")
     
    621634    (:environment-mismatch . report-compile-time-argument-mismatch)
    622635    (:lexical-mismatch . report-compile-time-argument-mismatch)   
     636    (:ftype-mismatch . report-compile-time-argument-mismatch)
    623637    (:type . "Type declarations violated in ~S")
    624638    (:type-conflict . "Conflicting type declarations for ~S")
Note: See TracChangeset for help on using the changeset viewer.