Commit d54c1103 authored by Marius Gerbershagen's avatar Marius Gerbershagen
Browse files

cmp: fix bad warnings for type declarations inside locally

Also search lexical environment for variables instead of only the
list of variables being established by the current form (which is nil
anyway in the case of locally; only let or multiple-value-bind
statements create new variables).

The declaration is still ignored, but fixing that would require a much
larger refactor because currently variable types are associated to the
variable itself. Thus the type can only be set for the full scope in
which the variable is active and not locally in some subscope.
parent 977e2fab
......@@ -176,7 +176,8 @@ special variable declarations, as these have been extracted before."
(defun check-vdecl (vnames ts is)
(loop for (name . type) in ts
unless (or (member name vnames :test #'eq)
(symbol-macro-declaration-p name type))
(symbol-macro-declaration-p name type)
(cmp-env-search-var name))
do (cmpwarn "Declaration of type~&~4T~A~&was found for not bound variable ~s."
type name))
(loop for (name . expected-uses) in is
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment