I'm trying to compile the following code in Scala 3 (worked on Scala 2.13):
import scala.concurrent.duration._
@main
def main(): Unit = {
case class AAA(d: FiniteDuration)
val duration1 = 5.seconds
implicit val what = AAA(duration1)
}
But getting the following error:
Recursive value duration1 needs type implicit val what = AAA(duration1)
Making the parameter non implicit fixed the error. Why?