Steel Bank Common Lisp

Style warning "undefined type" repeated despite corrected defun

Reported by Lutz Euler on 2011-07-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

SBCL version: 1.0.49-77

Juho was just asking to send in regressions before the freeze.
I hope one that exists already since several months is OK, too ;-)

At the REPL, I declared an undefined type in a defun and SBCL issues
a style warning. This is fine.
Next I repeated the defun, now with the corrected type name.
SBCL issues nearly the same style warning again.
I didn't expect that and find it confusing.
When repeating the defun once more with the corrected type name the
warning is gone, as I would have expected already after the first redefinition.

See transscript:

* (defun f (x)
    (declare (type num x))
    x)

; in: LAMBDA NIL
; (SB-INT:NAMED-LAMBDA F
; (X)
; (DECLARE (TYPE NUM X))
; (BLOCK F X))
; --> FUNCTION LOCALLY SB-C::%FUNCALL MULTIPLE-VALUE-BIND LET UNLESS IF
; ==>
; (TYPEP #:G3 'NUM)
;
; caught STYLE-WARNING:
; undefined type: NUM

; (TYPE NUM X)
;
; caught STYLE-WARNING:
; undefined type: NUM
;
; compilation unit finished
; Undefined type:
; NUM
; caught 2 STYLE-WARNING conditions

F
* (defun f (x)
    (declare (type fixnum x))
    x)

; (SB-INT:NAMED-LAMBDA F
; (X)
; (DECLARE (TYPE FIXNUM X))
; (BLOCK F X))
; ==>
; #'(SB-INT:NAMED-LAMBDA F
; (X)
; (DECLARE (TYPE FIXNUM X))
; (BLOCK F X))
;
; caught STYLE-WARNING:
; undefined type: NUM
;
; compilation unit finished
; Undefined type:
; NUM
; caught 1 STYLE-WARNING condition
STYLE-WARNING: redefining COMMON-LISP-USER::F in DEFUN

F
* (defun f (x)
    (declare (type fixnum x))
    x)
STYLE-WARNING: redefining COMMON-LISP-USER::F in DEFUN

F
*

This is a regression. Bisected to:

cb41e65e62328d1bd63df8477388503fa7e864bb is the first bad commit
commit cb41e65e62328d1bd63df8477388503fa7e864bb
Author: Nikodemus Siivola <email address hidden>
Date: Tue Oct 12 14:42:53 2010 +0000

    1.0.43.49: (SETF FDEFINITION) and (SETF SYMBOL-FUNCTION) should clear derived ftype

     Fixes 659220.

     Just call CLEAR-INFO unless the type is declared.

Sorry, Nikodemus, and kind regards

Lutz

Lutz Euler (lutz-euler) on 2011-07-05
tags: added: regression
Stas Boukarev (stassats) on 2011-08-02
Changed in sbcl:
status: New → Triaged
importance: Undecided → Low
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
Nikodemus Siivola (nikodemus) wrote :

e5b6856 muffle style-warnings for INFO :FUNCTION :TYPE

Changed in sbcl:
status: Triaged → Fix Committed
assignee: Nikodemus Siivola (nikodemus) → nobody
assignee: nobody → Nikodemus Siivola (nikodemus)
assignee: Nikodemus Siivola (nikodemus) → nobody
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