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

Bug #384892 reported by Tobias C. Rittweiler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
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

Tags: compiler
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
Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: 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.

Revision history for this message
Tobias C. Rittweiler (tcr) wrote : Re: COMPILE does a better job if there is an additional lambda (result-type derivation losage involving &more)

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
Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.