Skip to content

Instantly share code, notes, and snippets.

@luismbo
Created February 6, 2020 13:15
Show Gist options
  • Save luismbo/6e6e8dce55d4915e750071b5ce0f3ef8 to your computer and use it in GitHub Desktop.
Save luismbo/6e6e8dce55d4915e750071b5ce0f3ef8 to your computer and use it in GitHub Desktop.
SBCL compiler bug?
~/s/typep ❯❯❯ cat compiler-bug.lisp
(in-package :cl-user)
(defclass foo ()
())
(defun bar ()
(let ((x (non-existing-function-1)))
(when (typep x 'foo)
(non-existing-function-2 x))))
~/s/typep ❯❯❯ cat compiler-bug.sh
sbcl --eval '(load (compile-file "compiler-bug.lisp"))' --eval '(save-lisp-and-die "compiler-bug.core")'
sbcl --core compiler-bug.core --disable-debugger --eval "(print (typep 42 'foo))"
~/s/typep ❯❯❯ ./compiler-bug.sh
This is SBCL 1.4.14, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
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.
WARNING: the Windows port is fragile, particularly for multithreaded
code. Unfortunately, the development team currently lacks the time
and resources this platform demands.
; compiling file "Z:/siscog/typep/compiler-bug.lisp" (written 06 FEB 2020 01:08:56 PM):
; compiling (IN-PACKAGE :CL-USER)
; compiling (DEFCLASS FOO ...)
; compiling (DEFUN BAR ...)
; file: Z:/siscog/typep/compiler-bug.lisp
; in: DEFUN BAR
; (NON-EXISTING-FUNCTION-1)
;
; caught STYLE-WARNING:
; undefined function: NON-EXISTING-FUNCTION-1
; (NON-EXISTING-FUNCTION-2 X)
;
; caught STYLE-WARNING:
; undefined function: NON-EXISTING-FUNCTION-2
;
; compilation unit finished
; Undefined functions:
; NON-EXISTING-FUNCTION-1 NON-EXISTING-FUNCTION-2
; caught 2 STYLE-WARNING conditions
; wrote Z:/siscog/typep/compiler-bug.fasl
; compilation finished in 0:00:00.007
[undoing binding stack and other enclosing state... done]
[performing final GC... done]
[saving current Lisp image into compiler-bug.core:
writing 5968 bytes from the read-only space at 0000000020000000
writing 1712 bytes from the static space at 0000000020110000
writing 39321600 bytes from the dynamic space at 0000001000000000
done]
This is SBCL 1.4.14, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
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.
WARNING: the Windows port is fragile, particularly for multithreaded
code. Unfortunately, the development team currently lacks the time
and resources this platform demands.
Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
{10012E0613}>:
unknown type specifier: FOO
@luismbo
Copy link
Author

luismbo commented Feb 6, 2020

Fixed somewhere between SBCL 2.0.0 and 2.0.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment