aboutsummaryrefslogblamecommitdiff
path: root/tests/neg/static-implements.scala
blob: 8e8a8800cc15ecc587c290218be2a8bb59328743 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                             
import annotation.static

abstract class A { def x: Int }

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