Closed
Description
minimized code
object Foo {
given Liftable[Boolean] {
def toExpr(b: Boolean)(given QuoteContext): Expr[Boolean] =
if (b) '{ true } else '{ false }
}
}
I get:
[error] -- Error: /home/oscar/oss/olelo/src/main/scala/Olelo.scala:7:8 -----------------
[error] 7 | given Liftable[Boolean] {
[error] | ^
[error] |object creation impossible, since def toExpr(x: Boolean): (given quoted.QuoteContext) => quoted.Expr[Boolean] is not defined
[error] |(Note that T does not match Boolean)
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
expectation
The error message is confusing to me. What is T
? I don't mention that in my code. Also, it seems I have the method it is complaining about.
since this example is listed: https://dotty.epfl.ch/docs/reference/metaprogramming/macros.html
I thought this would work.