Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lockie opened this issue Jul 3, 2024 · 1 comment
Open

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

lockie opened this issue Jul 3, 2024 · 1 comment

Comments

@lockie
Copy link

lockie commented Jul 3, 2024

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
Copy link
Collaborator

easye commented Jul 6, 2024

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.

easye added a commit to easye/abcl that referenced this issue Jul 6, 2024
ADJUST-ARRAY throws "incompatible type" for (UNSIGNED-BYTE 32)

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

c.f. <armedbear#673>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants