Duplicate function names in FLET are accepted silently.

Bug #841246 reported by Jean-Philippe Paradis on 2011-09-04
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

What I do:
(flet ((foo () 1)
       (foo () 2))
  (foo))
=> 2

What happens:
No ERROR or WARNING of any kind is signaled.

What I expected to happen:
I expected to get at least a STYLE-WARNING.

Analysis:
I could not find anything in the CLHS regarding duplicate function names in a FLET, but here's a very similar form:
(let ((foo 1)
      (foo 2))
  foo)
error --> The variable FOO occurs more than once in the LET.

Given that LET and FLET work in exactly analogous ways as it relates to (parallel) binding of names (except they simply do so in different namespaces), I think duplicate binding names in FLET should be treated the same as duplicate binding names in LET.

SBCL version: 1.0.51
uname -a: Linux dynamorph 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:08:37 UTC 2011 i686 GNU/Linux

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ASDF-UNIX :ANSI-CL
 :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE
 :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX
 :SB-THREAD :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD
 :C-STACK-IS-CONTROL-STACK :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
 :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
 :LINKAGE-TABLE :OS-PROVIDES-DLOPEN :OS-PROVIDES-DLADDR :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL)

Changed in sbcl:
importance: Undecided → Wishlist
importance: Wishlist → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers