aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t704.scala
blob: aedd8c03afdc709747589555d995eb9df9727e1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
trait D {
  private val x = "xxxx should appear twice"
  private object xxxx { Console.println(x) }
  def get_xxxx: AnyRef = xxxx
}

trait E extends D {
  def f(): Unit = {
    val y = "yyyy should appear twice"
    object yyyy {
      val x1 = get_xxxx
      Console.println(y)
    }
    yyyy
  }
}
class C extends E {}
object Go extends D {
  def main(args : Array[String]): Unit = {
    new C().f()
    new C().f()
  }
}