Skip to content
New issue

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

Inconsistent behaviour of deriveConfig #1487

Open
dsame opened this issue Nov 22, 2024 · 0 comments
Open

Inconsistent behaviour of deriveConfig #1487

dsame opened this issue Nov 22, 2024 · 0 comments

Comments

@dsame
Copy link

dsame commented Nov 22, 2024

import zio.config.magnolia._ causes non-working code with the warning:

Infinite loop in function body zio.config.magnolia.deriveConfig[testapp.HttpServerConfig]( zio.config.magnolia.deriveConfigFromConfig[testapp.HttpServerConfig]( testapp.HttpServerConfig.configDescriptor) ).nested("HttpServerConfig")
image

Full code:

import zio.config.magnolia._

case class HttpServerConfig(host: String, port: Int)

object HttpServerConfig {
  implicit val configDescriptor: Config[HttpServerConfig] =
    deriveConfig[HttpServerConfig].nested("HttpServerConfig")
}

import zio.config.magnolia. deriveConfig fixes the problem:

import zio.config.magnolia.deriveConfig

case class HttpServerConfig(host: String, port: Int)

object HttpServerConfig {
  implicit val configDescriptor: Config[HttpServerConfig] =
    deriveConfig[HttpServerConfig].nested("HttpServerConfig")
}

I am not sure, but it seems this is confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant