-
Notifications
You must be signed in to change notification settings - Fork 31
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
Confusing error message for different types with same name #326
Comments
Note: type annotations don't help:
|
@b-studios helpfully told me that the problem is here: def sortFst[Int, B] ^ we're binding
|
We could check whether the two types print to the same and then use the fully qualified name. |
This should be (partially) addressed by #368. @jiribenes do you think this issue here is still relevant? |
It's better since now there's an additional message:
which is already helpful. But since we have namespaces, it would be nice to say something like:
Some logic like "If the types are named the same, print their whole qualified path". :) |
I've had a similar issue today while working on
Reproduction: import list
type List[A] {
Nil();
Cons(head: A, tail: List[A])
}
def main() = {
val list = Cons("foo", Cons("Bar", Nil()))
println(list)
} In my opinion, such code should throw some error message like "ambiguous type 'List[String]'". |
To reiterate my point from a year ago, I think we should print the "fully qualified" path (or the origin) if we notice we're writing a message like "Expected X but got X". So something like:
would already help in these "Expected X but got X" cases. |
I don't have any experience with Typer but I suppose we should add this check around here? effekt/effekt/shared/src/main/scala/effekt/Typer.scala Lines 1383 to 1389 in acb9c98
How would we attach the respective module name? |
Asked on the meeting:
|
Trying to write a sort that works on the first element of a tuple:
This is reproducible both on the website and on current
master
.I got the following error message:
Specifically, the very first part seems wrong:
This overload looks like it should work in my case (I'm comparing two
Int
s), but it gets refused for some mysterious reason.The text was updated successfully, but these errors were encountered: