eed3si9n / scalaxb

scalaxb is an XML data binding tool for Scala.

Home Page:http://scalaxb.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile error Scala 2.13.12 with `-Xsource:3`

xuwei-k opened this issue · comments

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]                  ^

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

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.