Skip to content

Weird printing of abstract override #12529

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

Closed
som-snytt opened this issue Feb 5, 2022 · 0 comments · Fixed by scala/scala#10103
Closed

Weird printing of abstract override #12529

som-snytt opened this issue Feb 5, 2022 · 0 comments · Fixed by scala/scala#10103
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) good first issue help wanted
Milestone

Comments

@som-snytt
Copy link

reproduction steps

using Scala 2.13.8,

trait A {
  def m(a:Int): Int
}

trait B extends A {
  override def m(a:Int): Int = { return a; }
}

trait C extends A {
  abstract override def m(a:Int):Int = { return super.m(a); }
}

trait D extends B with C {
  override def m(a:Int):Int = { return super.m(a); }
}

trait E extends C with B {
  abstract override def m(a:Int):Int = { return super.m(a); }
}

class X extends E with D

problem

➜  scalac -d /tmp i14415.scala
i14415.scala:22: error: `abstract override` modifiers required to override:
absoverride def m(a: Int): Int (defined in trait C)
  with override def m(a: Int): Int (defined in trait D)
class X extends E with D
      ^
1 error

Or, consider a feature request to support keyword absoverride. Which sounds like the latest workout hack to have a cut bod.

Noticed at scala/scala3#14415

@SethTisue SethTisue added this to the Backlog milestone Feb 5, 2022
zeesh49 added a commit to zeesh49/scala that referenced this issue Aug 4, 2022
in case of compilation error due to incorrect application of abstract override flags, the compiler output contained "absoverride" which have been changed to "abstract override"

link to the bug: scala/bug#12529
@SethTisue SethTisue modified the milestones: Backlog, 2.13.9 Aug 10, 2022
@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) good first issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants