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

Using index-unsafe on an empty vector errors with should be a non-negative integer below 0 (SBCL) #1068

Open
Izaakwltn opened this issue Mar 11, 2024 · 0 comments

Comments

@Izaakwltn
Copy link
Collaborator

Minute and insignificant issue, but it might be worth handling this error from Coalton with a clearer (and potentially attainable) error message:

(in-package #:coalton-user)

(coalton-toplevel

  (define empty-vector
    (vector:make))

  (define (index-empty-vector)
    (vector:index-unsafe 0 empty-vector)))

Returns the error:

Invalid index 0 for (COMMON-LISP:VECTOR COMMON-LISP:T 0), should be a non-negative integer below 0.
   [Condition of type SB-INT:INVALID-ARRAY-INDEX-ERROR]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant