TYPE-ERROR redefining class as structure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Confirmed
|
Low
|
Unassigned |
Bug Description
I found a reproducible way to provoke a TYPE-ERROR from the compiler. First define a class and then compile (only) a structure definition with the same name.
$ echo "(defstruct x)" > x.lisp
$ sbcl --eval '(defclass x () ())' --eval '(compile-file "x.lisp")'
This is SBCL 2.1.2.nixos, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
; compiling file "/home/luke/x.lisp" (written 01 SEP 2021 12:10:08 PM):
; processing (DEFSTRUCT X)
; file: /home/luke/x.lisp
; in: DEFSTRUCT X
; (DEFSTRUCT X)
; --> PROGN EVAL-WHEN
; ==>
; (SB-KERNEL:
; '#<SB-KERNEL:
; '#(#<SB-
; #<SB-KERNEL:LAYOUT (ID=2) for STRUCTURE-OBJECT {50201073}>))
;
; caught WARNING:
; change in superclasses of class #<SB-KERNEL:
; The current superclasses: (T SB-PCL::SLOT-OBJECT STANDARD-OBJECT)
; the most recently loaded superclasses: (T STRUCTURE-OBJECT)
debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {1001550103}>:
The value
NIL
is not of type
SB-
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [CONTINUE] Ignore runtime option --eval "(compile-file \"x.lisp\")".
1: [ABORT ] Skip rest of --eval and --load options.
2: Skip to toplevel READ/EVAL/PRINT loop.
3: [EXIT ] Exit SBCL (calling #'EXIT, killing the process).
(SB-KERNEL:
0]
$ uname -a
Linux thinky 5.13.9 #1-NixOS SMP Sun Aug 8 07:06:57 UTC 2021 x86_64 GNU/Linux
$ sbcl --version
SBCL 2.1.2.nixos
Changed in sbcl: | |
status: | New → Confirmed |
importance: | Undecided → Low |