Skip to content

Unhelpful implicit not found message for quotes.Quotes #16888

Closed
@odersky

Description

@odersky

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions