We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicits are not resolved when automatically deriving Configs for a sealed trait:
Configs
sealed trait
case class A1(b: B1) object A1 { implicit val cConfigs: Configs[C1] = { (c, _) => c.get[String]("d").map(C1.make) } implicit val bConfigs: Configs[B1] = Configs.autoDeriveConfigs[B1] implicit val aConfigs: Configs[A1] = Configs.autoDeriveConfigs[A1] } sealed trait B1 class C1 private(val d: String) extends B1 object C1 { def make(d: String): C1 = new C1(d) }
This fails with:
[error] C1 has no public constructor [error] implicit val bConfigs: Configs[B1] = Configs.autoDeriveConfigs[B1] [error] ^
The simple case works:
case class A2(b: B2) object A2 { implicit val aConfigs: Configs[A2] = Configs.autoDeriveConfigs[A2] } sealed trait B2 case class C2(d: String) extends B2
We can show that implicits are resolved when automatically deriving Configs for a case class:
case class
case class A3(b: C3) object A3 { implicit val cConfigs: Configs[C3] = { (c, _) => c.get[String]("d").map(C3.make) } implicit val aConfigs: Configs[A3] = Configs.autoDeriveConfigs[A3] } class C3 private(val d: String) object C3 { def make(d: String): C3 = new C3(d) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Implicits are not resolved when automatically deriving
Configs
for asealed trait
:This fails with:
The simple case works:
We can show that implicits are resolved when automatically deriving
Configs
for acase class
:The text was updated successfully, but these errors were encountered: