Changeset 11850


Ignore:
Timestamp:
Mar 27, 2009, 7:25:25 PM (10 years ago)
Author:
gz
Message:

handle typechecking for symbol-macrolet differently

File:
1 edited

Legend:

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

    r11836 r11850  
    10111011    (nx-error "Odd number of forms in ~s ." whole))
    10121012  (while args
    1013     (let ((sym (nx-need-var (%car args) nil))
    1014           (val (%cadr args)))
     1013    (let* ((sym (nx-need-var (%car args) nil))
     1014           (val (%cadr args))
     1015           (declared-type (nx-declared-type sym env)))
     1016      (when (nx-declarations-typecheck env)
     1017        (unless (or (eq declared-type t)
     1018                    (and (consp val) (eq (%car val) 'the) (equal (cadr val) declared-type)))
     1019          (setq val `(the ,declared-type ,val))
     1020          (nx-note-source-transformation (caddr val) val)))
    10151021      (multiple-value-bind (expansion win) (macroexpand-1 sym env)
    10161022        (if win
    1017             (push (nx1-form `(setf ,expansion ,val)) res)
    1018             (multiple-value-bind (info inherited catchp)
     1023            (push (nx1-form `(setf ,expansion ,val)) res)
     1024            (multiple-value-bind (info inherited catchp)
    10191025                (nx-lex-info sym)
    10201026              (push
     
    10271033                                       (nx-var-bits catchp)))
    10281034                     (nx1-form `(setf ,inherited ,val)))
    1029                    (let* ((valtype (nx-form-type val env))
    1030                           (declared-type (nx-declared-type sym)))
     1035                   (let ((valtype (nx-form-type val env)))
    10311036                     (let ((*nx-form-type* declared-type))
    1032                        (when (nx-declarations-typecheck env)
    1033                          (setq val `(the ,declared-type ,val))
    1034                          (nx-note-source-transformation (caddr val) val))
    10351037                       (setq val (nx1-typed-form val env)))
    10361038                     (if (and info (neq info :special))
     
    20222024        (dolist (var vars)
    20232025          (nx-check-var-usage var)
    2024           (when typecheck
     2026          (when (and typecheck
     2027                     (let ((expansion (var-expansion var)))
     2028                       (or (atom expansion) (neq (%car expansion) :symbol-macro))))
    20252029            (let* ((sym (var-name var))
    20262030                   (type (nx-declared-type sym)))
Note: See TracChangeset for help on using the changeset viewer.