Steel Bank Common Lisp

COMPILE does a better job if there is an additional lambda (result-type derivation lossage involving &more)

Reported by Tobias C. Rittweiler on 2009-06-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Medium
Unassigned

Bug Description

CL-USER> (format t "~&The type is ~S~%"
                 (sb-kernel:%simple-fun-type
                  (compile nil `(lambda (x y &key k1)
                                  (declare (fixnum x y))
                                  (declare (boolean k1))
                                  (declare (ignore x y k1))
                                  t))))
The type is (FUNCTION (FIXNUM FIXNUM &KEY (:K1 (MEMBER NIL T))) *)
NIL
CL-USER> (format t "~&The type is ~S~%"
                 (sb-kernel:%simple-fun-type
                  (funcall (compile nil `(lambda ()
                                           (lambda (x y &key k1)
                                             (declare (fixnum x y))
                                             (declare (boolean k1))
                                             (declare (ignore x y k1))
                                             t))))))
The type is (FUNCTION (FIXNUM FIXNUM &KEY (:K1 (MEMBER NIL T)))
             (VALUES (MEMBER T) &OPTIONAL))
NIL

Changed in sbcl:
importance: Undecided → Medium
status: New → Confirmed
tags: added: compiler
summary: - Difference in type derivation between file compiler and run-time
+ difference in type derivation between file compiler and run-time
compiler
description: updated
summary: - difference in type derivation between file compiler and run-time
- compiler
+ COMPILE does a better job if there is an additional lambda

The problem seems to be that in the first case the tail-set of the main-entry for the optional dispatch is not the same one the TL-XEP has -- which is the one what gets the return type properly.

The problem is more general than indicated at first.

I stumbled upon this bug a few months later, and came to the
same conclusion as Nikodemus regarding symptomatic
reasons:

  http://article.gmane.org/gmane.lisp.steel-bank.devel/14430

summary: - COMPILE does a better job if there is an additional lambda
+ COMPILE does a better job if there is an additional lambda (result-type
+ derivation losage involving &more)
summary: COMPILE does a better job if there is an additional lambda (result-type
- derivation losage involving &more)
+ derivation lossage involving &more)
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Confirmed → In Progress
Nikodemus Siivola (nikodemus) wrote :

This is related to bug 310173 and MAKE-TOPLEVEL-XEP not setting COMPONENT-REANALYZE to T, as far as I can tell.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Triaged
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Triaged → In Progress
Nikodemus Siivola (nikodemus) wrote :

In 1.0.44.4.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers