style-warning for recursive call in non-toplevel defgeneric

Bug #500318 reported by Tobias C. Rittweiler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Low
Unassigned

Bug Description

COMPILE-FILEing

(let ()
  (defgeneric fact2 (n)
    (:method ((n integer))
      (if (zerop n)
          1
          (* n (fact2 (1- n)))))))

(let ()
  (defun fact1 (n)
    (if (zerop n)
        1
        (* n (fact1 (1- n))))))

results in

; file: /tmp/foo.lisp
; in: DEFGENERIC FACT2
; (FACT2 (1- N))
;
; caught STYLE-WARNING:
; undefined function: FACT2
;
; compilation unit finished
; Undefined function:
; FACT2
; caught 1 STYLE-WARNING condition

As you see, the recursive call in the non-toplevel DEFUN results in no style-warning,
but the same for the DEFGENERIC form does.

This is valid behaviour, just a tad bit inconsistent.

Tags: compiler pcl
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
summary: - recursive call in non-toplevel defgeneric
+ style-warning for recursive call in non-toplevel defgeneric
tags: added: compiler pcl
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.