Wrong type assertion and load-time-value
Bug #823014 reported by
Stas Boukarev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
When compiling
(defvar *var* 10)
(declaim (fixnum *var*))
(defun foo ()
(the list (load-time-value *var*)))
=>error:
SB-
Which boils down to:
(defun foo ()
(the list (sb-ext:truly-the #.(sb-kernel:
Another issue is that SBCL doesn't produce nor a compile-time, neither a load-time warning when compiling
(defun foo ()
(the list (load-time-value 10)))
while it does produce it when just LOADing the .lisp
Changed in sbcl: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
status: | Confirmed → In Progress |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
commit ed066199124c469 98798122cc776e6 15c9c50372
Author: Nikodemus Siivola <email address hidden>
Date: Tue Aug 9 10:57:41 2011 +0300
LOAD-TIME-VALUE improvements
* Derive the type of :TOPLEVEL lambdas properly. Without this we were LOAD-TIME- STUFF.
never able to utilize the type from COMPILE-
* Use the source-type whenever it is more accurate than the type from
COMPILE- LOAD-TIME- STUFF -- eg. when using a value cell.
* Add ALIAS argument to IR1-CONVERT, allowing saving alternate forms
into *CURRENT-PATH*: this allows
(compile nil '(lambda () (the list (load-time-value *var*))))
to give the warning
; Derived type of *VAR* is
; (VALUES (INTEGER 10 10) &OPTIONAL),
; conflicting with its asserted type
; LIST.
instead of the much less useful
; Constant 10 conflicts with its asserted type LIST.
* Use THE-IN-POLICY directly in LOAD-TIME-VALUE, allowing the file-
compiler to report the LOAD-TIME-VALUE form for type-conflicts
instead of (TRULY-THE <type> (%LOAD-TIME-VALUE ...))