Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#840 closed defect (fixed)

Lisp non-conformance created by load

Reported by: brooks Owned by:
Priority: normal Milestone:
Component: ANSI CL Compliance Version: 1.6
Keywords: Cc:


Start a fresh CCL 1.6 (64bit Mac OS 10.6.7) and eval the following two forms; this will work as it should.

(defstruct foo a)

(defun baz () (flet ((foo-a (x y) (+ x y))) (foo-a 1 2)))

Now put the two forms in a file, and load the file. The result is a compiler error:

? (load "Users/brooks/Desktop/test.lisp")

Error: While compiling BAZ :

Extra args (1 2) for (LAMBDA (FOO) ...), in process Listener(6).

Alternatively, if the flet defined foo-a to have a single arg, then the compiler would not complain, but subsequently eval'ing (baz) will generate a type error:

? (baz)

Error: value 2 is not of the expected type FOO.

Change History (3)

comment:1 Changed 10 years ago by rme

Or, more simply:

(declaim (inline foo))
(defun foo (a)
  (+ a 42))

(defun bar ()
  ;;(declare (notinline foo))
  (flet ((foo (x y)
	   (+ x y)))
    (foo 1 2)))

We appear to be inlining the global definition of FOO within the body of the FLET. (Note that using the notinline declaration would avoid the bug.)

comment:2 Changed 10 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

(In [14703]) In nx-declared-inline-p and nx-declared-notinline-p, stop searching and return nil if there's a local function definition.

Fixes ticket:840.

comment:3 Changed 10 years ago by rme

(In [14713]) Merge r14703 from trunk.

See ticket:840.

Note: See TracTickets for help on using tickets.