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/confusing "no given instance" message wording re context function type #17122

Closed
dsbos opened this issue Mar 16, 2023 · 0 comments · Fixed by #17125
Closed

Unclear/confusing "no given instance" message wording re context function type #17122

dsbos opened this issue Mar 16, 2023 · 0 comments · Fixed by #17125
Assignees
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc
Milestone

Comments

@dsbos
Copy link

dsbos commented Mar 16, 2023

A tiny, single-word bit of non-clarity in error messages:

Compiler version

3.2.2

Minimized example

object UnclearError extends App {

  case class SomeContextThing()
  case class SomeResult()

  type ContextFunctionType = SomeContextThing ?=> SomeResult

  def m(): ContextFunctionType = ???

  m()
}

Output

<...>/src/main/scala/UnclearError.scala:11:6
No given instance of type UnclearError.SomeContextThing was found for parameter of UnclearError.ContextFunctionType
The required type is an alias of: (UnclearError.SomeContextThing) ?=> UnclearError.SomeResult
  m()

Note how that says "parameter of UnclearError.ContextFunctionType" instead of clearly/correctly saying "parameter of type UnclearError.ContextFunctionType".

(Note now the phrase "required type" there can seem to refer to "type UnclearError.SomeContextThing," since that's the only other occurrence of the word "type" in the error message. That is, it can seem like it's saying that "type UnclearError.SomeContextThing" "is an alias of: (UnclearError.SomeContextThing) ?=> UnclearError.SomeResult".)

Expectation

That the "parameter of " part of that message would be worded clearly as "parameter of type " (and hopefully other, similar reference to types would do the same).

@dsbos dsbos added the stat:needs triage Every issue needs to have an "area" and "itype" label label Mar 16, 2023
@nicolasstucki nicolasstucki added area:reporting Error reporting including formatting, implicit suggestions, etc and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 17, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Mar 17, 2023
@nicolasstucki nicolasstucki self-assigned this Mar 17, 2023
Dedelweiss pushed a commit to Dedelweiss/dotty that referenced this issue Apr 17, 2023
@Kordyjan Kordyjan added this to the 3.3.1 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants