armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
288 stars 29 forks source link

ADJUST-ARRAY throws "incompatible type" for (UNSIGNED-BYTE 32) #673

Open lockie opened 2 months ago

lockie commented 2 months ago

Hi! I'm using ABCL 1.9.2 @ OpenJDK 17.0.11. This code

(adjust-array (make-array 1 :element-type 'short-float) 2 :element-type 'short-float)

works perfectly, but this one

(adjust-array (make-array 1 :element-type '(unsigned-byte 32)) 2 :element-type '(unsigned-byte 32))

fails with ADJUST-ARRAY: incompatible element type. This certainly does not look right.

I'm no Java expert, but perhaps comparison of elementType in adjust_array.execute should be deeper than just elementType != array.getElementType() and take into account that elementType could be in fact a list?..

easye commented 2 months ago

I have confirmed your problem as still existing in abcl-1.9.3-dev.

Your diagnosis that the underlying Java implementation of adjust-array needs to be more sophisticated in presence of compound type specifiers is spot on https://github.com/armedbear/abcl/blob/master/src/org/armedbear/lisp/adjust_array.java#L66.