DEFTRANSFORM placement of declarations is wrong when :Policy arg is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
This bug concerns declarations in the transform's body code, not declarations that the transform's body generates.
* (sb-c::defknown grok (t) t (sb-c::foldable))
=> (GROK)
* (sb-c::deftransform grok ((x) * *) (declare (special ridiculous)) `(foo x))
=> GROK
* (sb-c::deftransform grok ((x) (vector) * :policy :fast) (declare (special ridiculous)) `(fast-foo x))
; in: SB-C:DEFTRANSFORM GROK
; (DECLARE (SPECIAL RIDICULOUS))
;
; caught WARNING:
; There is no function named DECLARE. References to DECLARE in some contexts
; (like starts of blocks) have special meaning, but here it would have to be a
; function, and that shouldn't be right.
[... rest of error text elided ...]
Expected result: Those should either both work (if it makes sense for DEFTRANSFORM to accept declarations at all), or both not work (if it doesn't).
The issue is simple - the expression (UNLESS ... ,@decls-body) is wrong. It stems from essentially the same code in CMUCL.
(defmacro deftransform (name (lambda-list &optional (arg-types '*) ...
(let (...
(
Changed in sbcl: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |