diff --git a/src/CHANGELOG b/src/CHANGELOG index 9647110d5..da1404457 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -28,6 +28,8 @@ ECL 10.3.2: - ecl_make_file_stream_from_fd() did not set the right mode in the stream structure. + - ECL did not understand type declarations that involved symbol macros. + * Visible changes: - The source location annotator records the original pathnames, not the diff --git a/src/cmp/cmpenv.lsp b/src/cmp/cmpenv.lsp index abc9032da..47524b26c 100644 --- a/src/cmp/cmpenv.lsp +++ b/src/cmp/cmpenv.lsp @@ -484,9 +484,17 @@ (c1add-declarations decls) (c2expr body))) +(defun symbol-macrolet-declaration-p (name type) + (let* ((record (assoc name (cmp-env-variables *cmp-env*)))) + (when (eq (second record) 'si::symbol-macro) + (let ((expression (macroexpand-1 name *cmp-env*))) + (cmp-env-register-symbol-macro name `(the ,type ,expression))) + t))) + (defun check-vdecl (vnames ts is) (loop for (var . type) in ts - unless (member var vnames :test #'eq) + unless (or (member var vnames :test #'eq) + (symbol-macrolet-declaration-p var type)) do (cmpwarn "Declaration of type~&~4T~A~&was found for not bound variable ~s." type var)) (loop for (var . expected-uses) in is