- Hello, I am trying to implement a Scala 3 macro that overrides a method. I am struggling with calling the
super
. My currently working attempt has to explicitly specify the result type of the method:
Super(This(cls), None).select(method).asExprOf[String]
I’d like to implement this in a generic way, something like:
Super(This(cls), None).select(method).asExprOf(using method.tree.asInstanceOf[DefDef].returnTpt.tpe.asType)
But I am getting, logically, the following error:
[error] | Found: scala.quoted.Type[? <: AnyKind]
[error] | Required: scala.quoted.Type[T]
[error] |
[error] | where: T is a type variable
Is there any way how to do this the right way? (edited)
new