Open
Description
Hi! I want to implement abstract inline method in macro and it fails. The only way I can derive this is via quotation (there are some compile time configuration, which properly can be used only in macro), so it would be really great to allow this.
Compiler version
3.3.5 and 3.6.3
Minimized code
trait TokenWriter
trait JsonWriter[A]:
inline def write(value: A, tokenWriter: TokenWriter): Unit
object JsonWriter:
inline def derived[A]: JsonWriter[A] = ${ derivedMacro[A] }
def derivedMacro[A](using quotes: scala.quoted.Quotes): scala.quoted.Expr[JsonWriter[A]] =
import quotes.reflect.*
'{
new JsonWriter[A]:
inline def write(value: A, tokenWriter: TokenWriter): Unit = ()
}
Output
[error] 308 | inline def write(value: T, tokenWriter: TokenWriter): Unit =
[error] | ^
[error] | inline def cannot be within quotes
Expectation
Compiles