Style warning "undefined type" repeated despite corrected defun
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
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:
; (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:
; (X)
; (DECLARE (TYPE FIXNUM X))
; (BLOCK F X))
; ==>
; #'(SB-INT:
; (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:
cb41e65e62328d1
commit cb41e65e62328d1
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
tags: | added: regression |
Changed in sbcl: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
e5b6856 muffle style-warnings for INFO :FUNCTION :TYPE