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

Is it possible to intentionally fail at compile time? #324

Open
calvinlfer opened this issue Jul 3, 2021 · 1 comment
Open

Is it possible to intentionally fail at compile time? #324

calvinlfer opened this issue Jul 3, 2021 · 1 comment

Comments

@calvinlfer
Copy link

Hey there!
Thank you for this amazing library. I have a use case in Scala 2.x where I would like to fail at compile time given some some criteria (for example, the sealed trait should not contain any case objects for its terms), do you think this it’s possible do something like this?

This is similar to throwing compile time failures during inlines in Scala 3.x

@adamw
Copy link
Member

adamw commented Jul 3, 2021

You can do it with a custom macro, which could call magnolia. So doable, but not implemented in magnolia itself :)

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

2 participants