0.8.21.38: fix bug 211e
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 14 Apr 2005 10:24:10 +0000 (10:24 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 14 Apr 2005 10:24:10 +0000 (10:24 +0000)
 * mark duplicate keyword arguments as ignored in CONVERT-MORE-CALL.

BUGS
NEWS
src/compiler/locall.lisp
tests/compiler.impure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index ba4e1f1..656648f 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -585,18 +585,6 @@ WORKAROUND:
 211: "keywords processing"
   a. :ALLOW-OTHER-KEYS T should allow a function to receive an odd
      number of keyword arguments.
-  e. Compiling
-
-      (flet ((foo (&key y) (list y)))
-        (list (foo :y 1 :y 2)))
-
-     issues confusing message
-
-       ; in: LAMBDA NIL
-       ;     (FOO :Y 1 :Y 2)
-       ;
-       ; caught STYLE-WARNING:
-       ;   The variable #:G15 is defined but never used.
 
 212: "Sequence functions and circular arguments"
   COERCE, MERGE and CONCATENATE go into an infinite loop when given
diff --git a/NEWS b/NEWS
index 0692ab7..a5f3458 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,9 @@ changes in sbcl-0.8.22 relative to sbcl-0.8.21:
     *ERROR-OUTPUT*, not *STANDARD-OUTPUT*.
   * fixed inference of the upper bound of an iteration variable.
     (reported by Rajat Datta).
+  * fixed bug 211e: calling local functions with duplicated constant
+    keyword argument no longer causes a bogus style warning about an
+    unused variable.
   * fixed bug 305: INLINE/NOTINLINE declaration no longer causes local
     ftype declaration to be disregarded. (reported by Dave Roberts)
   * fixed bug 373: caused by erronous compilation of references to alien
index 71a65dc..f8211b7 100644 (file)
            (let ((name (lvar-value lvar))
                  (dummy (first temp))
                  (val (second temp)))
-              ;; FIXME: check whether KEY was supplied earlier
               (when (and (eq name :allow-other-keys) (not allow-found))
                 (let ((val (second key)))
                   (cond ((constant-lvar-p val)
                                (setq loser (list name)))))
                (let ((info (lambda-var-arg-info var)))
                  (when (eq (arg-info-key info) name)
-                   (ignores dummy)
-                   (supplied (cons var val))
-                   (return)))))))
+                     (ignores dummy)
+                     (if (member var (supplied) :key #'car)
+                         (ignores val)
+                         (supplied (cons var val)))
+                     (return)))))))
 
        (when (and loser (not (optional-dispatch-allowp fun)) (not allowp))
          (compiler-warn "function called with unknown argument keyword ~S"
index 94fa639..5baf7d1 100644 (file)
   (expect-pass 'inline)
   (expect-pass 'notinline))
 
+;;; bug 211e: bogus style warning from duplicated keyword argument to
+;;; a local function.
+(handler-bind ((style-warning #'error))
+  (let ((f (compile nil '(lambda () (flet ((foo (&key y) (list y)))
+                                     (list (foo :y 1 :y 2)))))))
+    (assert (equal '((1)) (funcall f)))))
+
 ;;; success
 (quit :unix-status 104)
index 665fecf..ff0ac14 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.21.37"
+"0.8.21.38"