Compile time type warning from valid calls to various string and sequence functions

Bug #1813338 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

 (lambda (p) (declare (optimize speed)) (string-left-trim (the (member "x" "1") p) "a"))

==>

; in: LAMBDA (P)
; (STRING-LEFT-TRIM (THE (MEMBER "x" "1") CL-TEST::P) "a")
; --> FLET SB-C::CHAR-NOT-IN-BAG BLOCK NOT IF FIND NTH-VALUE
; --> MULTIPLE-VALUE-BIND LET SB-KERNEL:%FIND-POSITION
; --> SB-KERNEL:%FIND-POSITION-VECTOR-MACRO LET* SB-KERNEL:WITH-ARRAY-DATA LET
; --> LET LET MULTIPLE-VALUE-BIND
; ==>
; (MULTIPLE-VALUE-CALL
; #'(LAMBDA
; (
; &OPTIONAL (#:SEQUENCE75) (SB-C::START) (#:END76) (#:OFFSET71)
; &REST #:G82)
; (DECLARE (IGNORE #:G82))
; (BLOCK #:BLOCK72
; (IF SB-C::FROM-END
; (LOOP SB-C::FOR #:INDEX73 SB-C::OF-TYPE SB-KERNEL:INDEX-OR-MINUS-1 SB-C::FROM # SB-C::DOWNTO SB-C::START
; DO #)
; (LOOP SB-C::FOR #:INDEX73 SB-C::OF-TYPE SB-INT:INDEX SB-C::FROM SB-C::START SB-C::BELOW #:END76
; DO #))
; (VALUES NIL NIL)))
; (COND
; ((NOT (SB-KERNEL:ARRAY-HEADER-P #:N-ARRAY77))
; (LET (#)
; (DECLARE #)
; (LET #
; #)))
; (T (SB-KERNEL:%WITH-ARRAY-DATA/FP #:N-ARRAY77 #:N-SVALUE78 #:N-EVALUE79))))
;
; caught WARNING:
; Derived type of
; (VALUES (SB-EXT:TRULY-THE SIMPLE-ARRAY #:N-ARRAY77) #:N-SVALUE78 #:N-END81 0)
; is
; (VALUES NULL &OPTIONAL),
; conflicting with its asserted type
; (MOD 4611686018427387901).
; See also:
; The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
; caught 1 WARNING condition
#<FUNCTION (LAMBDA (P)) {53125B8B}>

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

This appears to be affecting many other sequence functions also, not just string-left-trim.

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

Also causes the problem:

 (lambda (p) (declare (optimize speed)) (string-left-trim (the (or (simple-string 1) (simple-string 2)) p) "a"))

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

(lambda (x) (declare (optimize speed)) (find-if #'null (the (or (simple-vector 2) (simple-vector 3)) x)))

summary: - Compile time type warning from valid code: string-left-trim
+ Compile time type warning from valid calls to various string and
+ sequence functions
Revision history for this message
Stas Boukarev (stassats) wrote :

a111230c45058d2b5568718610b3356b5eb10c1b

Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats)
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.