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

compile error Scala 2.13.12 with -Xsource:3 #606

Open
xuwei-k opened this issue Oct 3, 2023 · 2 comments
Open

compile error Scala 2.13.12 with -Xsource:3 #606

xuwei-k opened this issue Oct 3, 2023 · 2 comments

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented Oct 3, 2023

scalaxb generate package object with extends XMLProtocol

object `package` extends XMLProtocol { }

xmlprotocol.scala:12:18: package object inheritance is deprecated (https://github.com/scala/scala-dev/issues/441);
[error] drop the `extends` clause or use a regular object instead
[error] Scala 3 migration messages are errors under -Xsource:3. Use -Wconf / @nowarn to filter them or add -Xmigration to demote them to warnings.
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=scala3-migration
[error] object `package` extends XMLProtocol { }
[error]                  ^
@eed3si9n
Copy link
Owner

eed3si9n commented Oct 5, 2023

I guess we'd have to pick some other solution, like call it object XMLProtocol instead, and tell everyone to add imports everywhere.

@som-snytt
Copy link

som-snytt commented Oct 5, 2023

It was deprecated and undeprecated, and received a meh from dotty at scala/scala#7662 (comment)

I'll look at where it came back deprecated. Some adjustments to -Xsource:3 are expected to make it less annoying in 2.13.13, and this seems like a good candidate.

Edit: what a tangled web of history. The deprecation was going to be reverted, but then they decided on -Xsource:2.14 which became -Xsource:3. scala/scala#7662

While it is true that the dotty issue tracker makes noises about not caring about package object bugs because they will go away, probably Scala 2 should only warn under -Xsource:4. Ask me if I'm joking.

The -Wconf:cat=scala3migration&site=xmlprotocol:s solution might be ok? The annoying part is cross-compiling.

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

3 participants