Steel Bank Common Lisp

multiple-value type assertion stupidity

Reported by Nikodemus Siivola on 2010-10-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

(compile nil `(lambda (s) (the (unsigned-byte 8) (read-byte s))))

gives

; (THE (UNSIGNED-BYTE 8) (READ-BYTE S))
;
; note: type assertion too complex to check:
; (VALUES (UNSIGNED-BYTE 8) &REST T).

This is silly.

While (THE X (FOO)) is too complex to check when the number of values returned by FOO is in doubt, here we know that READ-BYTE will only return a single value -- and hence we could simplify the assertion to (VALUES (UNSIGNED-BYTE 8) &OPTIONAL).

Nikodemus Siivola (nikodemus) wrote :

I misdiagnosed this initially.

The issue is really that READ-BYTE has been declared NOTINLINE, and NOTLINE currently has the side-effect of stopping the compiler from utilizing the proclaimed FTYPE.

Nikodemus Siivola (nikodemus) wrote :

In 1.0.43.39.

Changed in sbcl:
status: Triaged → 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