&rest list type derivation is brittle
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(in-package :sb-c)
(defknown compiler-
(deftransform compiler-
(delay-
(let ((type (type-specifier (lvar-type x))))
`(values ',type t)))
(defun compiler-
(declare (ignore x))
(values t nil))
(export 'compiler-
(in-package :cl-user)
;;; As expected
CL-USER> (funcall (compile nil `(lambda (&rest list)
LIST
T
;;; Oops. We should get LIST, T here too.
CL-USER> (funcall (funcall (compile nil `(lambda ()
T
T
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
status: | Triaged → In Progress |
description: | updated |
Changed in sbcl: | |
assignee: | nobody → Nikodemus Siivola (nikodemus) |
status: | Fix Committed → In Progress |
Changed in sbcl: | |
assignee: | Nikodemus Siivola (nikodemus) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
In the first case, the VARARGS-ENTRY is turned into a :LET, and PROPAGATE-LET-ARGS gets the type to the LAMBDA-VAR.
In the second case, the VARARGS-ENTRY is not turned into a :LET, and PROPAGATE-LET-ARGS doesn't happen.