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

Provide hints on failed unification errors #514

Open
ghallak opened this issue Nov 8, 2024 · 1 comment
Open

Provide hints on failed unification errors #514

ghallak opened this issue Nov 8, 2024 · 1 comment

Comments

@ghallak
Copy link
Contributor

ghallak commented Nov 8, 2024

In the following example contract:

contract C =
    entrypoint f(x) =
        let s = "str1"
        let t = "str2"
        let c = s + t
        c

The type checker will produce the error message:

type_error: Cannot unify `string` and `int`
At: Line 3, column 13

The error message does not give any hints on why it's trying to unify a string with an int, especially that it doesn't mention line 5, where s is the left hand side of the + operator, which is expected to be an int.

@nikita-fuchs
Copy link
Contributor

that would be a great help !

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