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

Exclusive Or When Deriving Sum Data Types #1501

Open
khajavi opened this issue Dec 14, 2024 · 0 comments
Open

Exclusive Or When Deriving Sum Data Types #1501

khajavi opened this issue Dec 14, 2024 · 0 comments

Comments

@khajavi
Copy link
Member

khajavi commented Dec 14, 2024

Assume the following ADT:

sealed trait DatabaseConfig
case class MysqlConfig(
  host: String,
  port: Int,
  username: String,
  password: Secret
) extends DatabaseConfig
case class SqliteConfig(path: String)
  extends DatabaseConfig

I expect that the deriveConfig[DatabaseConfig] macro derives a config that describes a config that can only either MysqlConfig or SqliteConfig, so when loading config from a file if two of them exist, I expect that throws an error instead of loading one of the configs from the config file.

@khajavi khajavi transferred this issue from zio/zio Dec 14, 2024
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