MAKE-ARRAY makes the unexpected array element type upgrade

Bug #560318 reported by Roman Marynchak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Low
Unassigned

Bug Description

This form

(make-array 8 :element-type 'foo)

surprisingly returns #(0 0 0 0 0 0 0 0) instead of claiming about the undefined type specifier FOO.

One may think that this is a kind of an implicit array element type upgrade to T... But why this form

(upgraded-array-element-type 'foo)

claims about the undefined type FOO instead of returning T in this case?

I think that MAKE-ARRAY should verify :element-type value to be a valid type specifier.

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Without checking CLHS requirements, this seems sensible.

Changed in sbcl:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Douglas Katzman (dougk) wrote :

CLHS mentions "Exceptional Situations: None." for MAKE-ARRAY.
Of course, CLHS mentions no exceptional situations for UPGRADED-ARRAY-ELEMENT-TYPE either.
Probably it should be STYLE-WARNING if detected at compile-time and an error at runtime.

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.