From 96a139f451963981fc2419410f468bae1a5d25d2 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 14 Apr 2005 10:24:10 +0000 Subject: [PATCH] 0.8.21.38: fix bug 211e * mark duplicate keyword arguments as ignored in CONVERT-MORE-CALL. --- BUGS | 12 ------------ NEWS | 3 +++ src/compiler/locall.lisp | 9 +++++---- tests/compiler.impure.lisp | 7 +++++++ version.lisp-expr | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/BUGS b/BUGS index ba4e1f1..656648f 100644 --- 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 --- 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 diff --git a/src/compiler/locall.lisp b/src/compiler/locall.lisp index 71a65dc..f8211b7 100644 --- a/src/compiler/locall.lisp +++ b/src/compiler/locall.lisp @@ -648,7 +648,6 @@ (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) @@ -665,9 +664,11 @@ (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" diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index 94fa639..5baf7d1 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1029,5 +1029,12 @@ (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) diff --git a/version.lisp-expr b/version.lisp-expr index 665fecf..ff0ac14 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4