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

headers.scala case classes have package private constructors - Scala 3 enforces this #304

Open
pjfanning opened this issue Aug 17, 2023 · 2 comments

Comments

@pjfanning
Copy link
Contributor

pjfanning commented Aug 17, 2023

For some reason, Scala 2 seems to allow public access to package private constructors but Scala 3 enforces it.

We also had to relax the scope on 2 constructors to allow pekko-connectors to compile with Scala 3.

#178

It turns out that Tapir also uses these exact same constructors but Tapir is in its own package. Tapir recently added Pekko HTTP support but didn't add Scala 3 support for Pekko HTTP (softwaremill/tapir#3114).

Should we start making these constructors (see #178) public?

If so, should we backport to 1.0.1 even though this will probably affect binary compatibility?

Adding a hacky org.apache.pekko scoped util class to Tapir should allow a workaround that can create Content-Length/Content-Type instances.

wdyt? @jrudolph @mdedetrich

@pjfanning
Copy link
Contributor Author

Looks like the Tapir team have worked around this issue so that means we don't need to make an immediate change - but it might still be worth considering whether to make the constructors public.

@jrudolph
Copy link
Contributor

We shouldn't just make something public that was made private intentionally (i.e. probably because we want to uphold some invariants). That said, if there's a need for a public API, we can look into what's needed and add that.

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