Keyword argument checking and apply
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Compiling a file with the following function results in the note below.
(defun test-fun ()
(apply 'find '(3 (1 2 3) :from-end t)))
; in: DEFUN TEST-FUN
; (APPLY 'FIND '(3 (1 2 3) :FROM-END T))
; --> MULTIPLE-VALUE-CALL
; ==>
; (SB-C::%FUNCALL #'FIND #:G2 #:G3 #:G4 #:G5)
;
; note: The third argument (in keyword position) is not a constant, weakening keyword
; argument checking.
It's a very unintuitive note because as the programmer's written it, :from-end is definitely a constant. Additionally, some macros like alexandria:removef and uiop:define-package (prior to 3.3.1.4 at least) use apply in this way and can end up generating enough notes in code that uses them a lot to drown out real issues.
sbcl --version:
SBCL 1.4.4
uname -a:
Linux rocinante 4.14.19-gentoo #1 SMP Fri Feb 16 20:35:41 EST 2018 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux
*features*:
(ALEXANDRIA.
:SB-BSD-
:ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-
:64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
:C-STACK-
:COMPARE-
:FP-AND-
:IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
:LINUX :LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-SIGNED-WORD :RELOCATABLE-HEAP :SB-CORE-
:SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-THREAD :SB-UNICODE :SB-XREF-
:STACK-
:STACK-
:STACK-
:UNDEFINED-
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
2cfa0e5b06b2e10 93a629760d0ebda 6bcd3c6c68