CLOS issues spurious warning on ignored argument

Bug #898331 reported by Faré
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

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))
                                            remaining-segment-requests
                                            all-segment-requests)
  "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.

Revision history for this message
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
; caught STYLE-WARNING:
; 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?

Revision history for this message
Faré (fahree) wrote :

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

Revision history for this message
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).

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Fixed in my pending tree.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: New → In Progress
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.