8000 @static field should not be allowed to implement / override · Issue #1224 · scala/scala3 · GitHub
[go: up one dir, main page]

Skip to content 8000
@static field should not be allowed to implement / override #1224
@lrytz

Description

@lrytz
import annotation.static

abstract class A { def x: Int }

class T
object T extends A {
  @static override val x = 10
  def main(args: Array[String]): Unit = {
    println((this: A).x)
  }
}

compiles, gives java.lang.AbstractMethodError: A.x()I

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0