-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Overriding parameterless trait methods when cross compiling #16742
kyri-petrou
started this conversation in
General Discussion
-
Hi there. I'm trying to cross compile a library to Scala 3, but I'm stuck with the following:
In Scala 2.12 / 2.13 the following is allowed:
trait Foo { def foo(): String } case class Bar(override val foo: String) extends Foo
However, in Scala 3, the following error is raised:
error overriding method foo in trait Foo of type (): String;
value foo of type String has incompatible type
case class Bar(foo: String) extends Foo
Is there anything that could be done in this case (e.g., a compiler flag) to allow this code to be cross-compiled for both Scala 2 and 3?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment