CLOS issues spurious warning on ignored argument

Bug #898331 reported by Faré on 2011-11-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

On recent versions of SBCL, this method causes a warning

(defmethod convert-ic-action-to-ic-request ((request qapi-clear-wait-list-action)
                                            (type (eql :cancel))
  "Creates ic-waitlisted-space-request to be used to cancel IC inventory."
  (declare (ignore all-segment-requests))

I cannot easily reduce this to a simple error case yet, or pin-point where exactly it started.

all-segment-requests is not used in this method (so agree CCL and older SBCL, e.g. 1.0.41). There are no next methods, but some other methods for same gf (all of which only dispatch on the first two arguments) do use the fourth argument.

If these hints are not enough to guess what's happening, I can try to pin-point the error and/or to reduce the test case.

Faré (fahree) wrote :

It appears that the
  (check-type request qapi-space-inventory-action) ;; must be both types
just after that declare in the function body is somehow causing the error.

If I remove that check, the function compiles. If I add it back, it causes a
; reading an ignored variable: ALL-SEGMENT-REQUESTS

NB: results obtained by using the RETRY restart while I have a
(eval-when (:compile-toplevel :load-toplevel :execute) (error "foo"))
right after the function, to make sure I can error and retry even when it works.

Does this information help?

Faré (fahree) wrote :

A (check-type request t) causes the error.
A check-type on type or remaining-segment-requests doesn't.

Nikodemus Siivola (nikodemus) wrote :

Aha. This is PCL rebinding the arguments when it doesn't need to (which is silly), and not migrating the declarations to the new bindings (which is wrong).

Nikodemus Siivola (nikodemus) wrote :

Fixed in my pending tree.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: New → In Progress
Nikodemus Siivola (nikodemus) wrote :

b7d7030 less rebindings in defmethods

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers