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

Unhelpful implicit not found message for quotes.Quotes #16888

Closed
odersky opened this issue Feb 11, 2023 · 0 comments
Closed

Unhelpful implicit not found message for quotes.Quotes #16888

odersky opened this issue Feb 11, 2023 · 0 comments
Assignees
Labels
area:documentation area:metaprogramming:quotes Issues related to quotes and splices area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement

Comments

@odersky
Copy link
Contributor

odersky commented Feb 11, 2023

Compiler version

3.3.0

Minimized example

scala> summon[quoted.Quotes]

Output

-- [E172] Type Error: ----------------------------------------------------------
1 |summon[quoted.Quotes]
  |                     ^
  |No given instance of type quoted.Quotes was found for parameter x of method summon in object Predef
1 error found

Many operations take a Quotes implicit parameter, but the user is left in the dark how to generate one. Looking up
Quotes in the Scala Doc API, I see:

Quotation context provided by a macro expansion or in the scope of scala.quoted.staging.run. Used to perform all operations on quoted Expr or Type.

It contains the low-level Typed AST API metaprogramming API. This API does not have the static type guarantees that Expr and Type provide

That's not very helpful either. I am still left in the dark how to produce a given Quotes.

Expectation

  1. A better implicit not found message.
  2. A better doc comment for Quotes that contains a full example.
@odersky odersky added the stat:needs triage Every issue needs to have an "area" and "itype" label label Feb 11, 2023
@odersky odersky added area:documentation area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 11, 2023
@nicolasstucki nicolasstucki added the area:metaprogramming:quotes Issues related to quotes and splices label Feb 14, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 14, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 15, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 15, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Feb 15, 2023
Dedelweiss pushed a commit to Dedelweiss/dotty that referenced this issue Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation area:metaprogramming:quotes Issues related to quotes and splices area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants