Strange behaviour of subtypep with undefined types

Bug #1886808 reported by Syll
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Won't Fix
Undecided
Unassigned

Bug Description

With attached code file :
    (load "code")
    (f)
    (with-compilation-unit () (f))

=> subtypep signals a style-warning after execution of (with-compilation-unit () (f)).
   (but not while loading/compiling the file, calling (f), nor during execution of f itself)

Discussion on this bug (https://bugs.launchpad.net/sbcl/+bug/716819) concluded that subtypep should not signal an error when types don't exist.

----

SBCL 2.0.5

Revision history for this message
Syll (syll) wrote :
Revision history for this message
Douglas Katzman (dougk) wrote :

Wrapping a compilation unit around code that you're trying to compile causes the compiler to "notice" that code will possibly be compiled suboptimally if you references types that are unknown.
In your minimal example there is no code that actually causes bad assembly code to be emitted, nor would it necessarily be construed as style-warning-worthy, but that's the effect that the compilation unit has.

But *NOT* wrapping a compilation-unit does *not* ask the compiler to notice such things.

For further details see the handler in
 (defun %with-compilation-unit ...
  (handler-bind ((parse-unknown-type
                   (lambda (c)
                     (note-undefined-reference (parse-unknown-type-specifier c)
                                               :type))))

You may not desire this behavior, but it is what it is.

Changed in sbcl:
status: New → Won't Fix
Revision history for this message
Douglas Katzman (dougk) wrote :

(launchpad doesn't have "working as designed" as a status, so I've marked it as "won't fix", but feel free to submit a patch if you feel that there is a better behavior)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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