scala3
scala3 copied to clipboard
Cyclic reference being computed where non exists
Compiler version
3.1.1
Minimized code
See this Scastie: https://scastie.scala-lang.org/TA9CIzqHS86RzcpAidG2UA
object Test {
import com.typesafe.config.ConfigFactory
import io.getquill.*
case class H2JObject(obj: Any)
val ctx = new H2JdbcContext(CamelCase, ConfigFactory.parseString(""))
implicit def a: ctx.Encoder[H2JObject] = ???
implicit def b: ctx.Decoder[H2JObject] = ???
}
Output
Cyclic reference involving val ctx at both implicit defs
Expectation
Code should compile fine. This happens when using given instead of implicit as well. The solution is to explicitly write the type of ctx
why is this assigned to me @anatoliykmetyuk ? I don't work on the compiler