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

Unclear error message for heterogenous list #1236

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

Unclear error message for heterogenous list #1236

Izaakwltn opened this issue Sep 11, 2024 · 0 comments

Comments

@Izaakwltn
Copy link
Collaborator

The error message doesn't tell you explicitly that you have a list containing different types of objects.

(coalton-toplevel
  (define wut (make-list 1.0d0 2.0d0 3.0)))
error: Type mismatch
  --> repl input:3:4
   |
 3 |      (MAKE-LIST 1.0d0 2.0d0 3.0)))
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected type '(LIST DOUBLE-FLOAT)' but got '(LIST SINGLE-FLOAT)'
   [Condition of type COALTON-IMPL/TYPECHECKER/BASE:TC-ERROR]

The previous error message, according to the docs, was:

Failed to unify types SINGLE-FLOAT and INTEGER
in unification of types (INTEGER → (LIST SINGLE-FLOAT) → :A) and (:B → (LIST :B) → (LIST :B))
in definition of WUT
in COALTON-TOPLEVEL
   [Condition of type COALTON-IMPL/TYPECHECKER::COALTON-TYPE-ERROR-CONTEXT]
@jbouwman jbouwman changed the title Unclear eror message for heterogenous list Unclear error message for heterogenous list Sep 12, 2024
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