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

Conflicting type variable bindings leads to contradictory error message #113

Closed
avh4 opened this issue Apr 23, 2016 · 4 comments
Closed
Labels

Comments

@avh4
Copy link
Member

avh4 commented Apr 23, 2016

In 0.16: In the following,

type alias T a b c =
  { a : a, b : b, c : c }

f : T a b a -> ()
f _ = ()

x : T Int Float String -> ()
x = f

The error message is confusing and contradicts itself:

TYPE MISMATCH
The type annotation for `x` does not match its definition.

9| x : T Int Float String -> ()
The type annotation is saying:

    T Int Float Int -> ()

But I am inferring that the definition has this type:

    T Int Float Int -> ()

It shows the source code with the type annotation T Int Float String -> (), and then states that the type annotation says T Int Float Int -> ().

Instead, the error message should state "The type annotation is saying: T Int Float String -> ()"

@jvoigtlaender
Copy link

jvoigtlaender commented Apr 23, 2016

This "the compiler says two types are different, but shows the exact same two types" thing comes up so often. See elm/compiler#1192 and all the issues showing up as references there. We really need a process to avoid people opening duplicates after duplicates of issues. I think elm/compiler#1342 is a good start.

@jvoigtlaender
Copy link

This is supposed to be fixed now. See elm/compiler#1192 (comment).

@jvoigtlaender
Copy link

Actually it's not fixed. See elm/compiler#1371.

@rtfeldman
Copy link
Member

Closing this since there is a compiler issue tracking it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants