Compiler bug
Describe the bug
When compiling the following code:
(declaim (inline f))
(defun f (a)
(check-type a unsigned-byte)
a)
(defun g ()
(let ((a 0))
(flet ((h ())
(k (&optional b)
(f a)))
(h))))
Compiler signals an error:
; Byte Compiling Top-Level Form:
; Byte Compiling Top-Level Form:
; Converted F.
; Compiling DEFUN F:
; Converted G.
Error in function LISP::ASSERT-ERROR:
The assertion (EQ (C::FUNCTIONAL-KIND (C::LAMBDA-HOME C::FUN))
:TOP-LEVEL) failed.
[Condition of type SIMPLE-ERROR]
Restarts:
0: [CONTINUE] Retry assertion.
1: [ABORT ] Return to Top-Level.
Debug (type H for help)
(LISP::ASSERT-ERROR (EQ (C::FUNCTIONAL-KIND #) :TOP-LEVEL) NIL NIL)
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer exists:
target:code/macros.lisp.
0]
To Reproduce
Save the code above to a file (say "test.lisp") and run
cmucl -eval '(compile-file "cmucl-flet-bug.lisp")'
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
- OS: Linux
- Version: 21e and 21d