How to access parameter list of case class in a dotty macro

Using standard type class derivation in Dotty import scala.deriving.Mirror case class ParseError(str: String, msg: String) trait Decoder[T]{ def decode(str:String): Either[ParseError, T] } object Decoder { given Decoder[String] with { override def decode(str: String): Either[ParseError, String] = Right(str) } given Decoder[Int] with { override def decode(str: String): Either[ParseError, Int] = str.toIntOption.toRight(ParseError(str, “value is not valid Int”)) … Read more

In scala 2 or 3, is it possible to debug implicit resolution process in runtime?

You can debug implicits at compile time: switch on compiler flag -Xlog-implicits try to resolve implicits manually (maybe specifying type parameters as well) and see compile errors implicitly[…](…manually…) use scala.reflect println(reify { implicitly[…] }.tree) (or switch on compiler flag -Xprint:typer) in order to see how implicits are resolved use IDE functionality to show implicits using … Read more