Skip to content

improve "Their kinds differ" error message #13872

Description

@ygrek
$ ocaml -stdin <<EOF
type x=T
type a=x=T
type y=x
type b=y=T
EOF
File "(stdin)", line 4, characters 0-10:
4 | type b=y=T
    ^^^^^^^^^^
Error: This variant or record definition does not match that of type y
       Their kinds differ.

I guess there is a reason why compiler wouldn't follow the type abbreviation but error message is confusing for the beginners, i think it can be improved by explaining a little more (what is that "kind") - e.g. "Their kinds differ - this type b is a re-exported variant (equation and representation) while type y is an abbreviation (equation without representation)."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions