summaryrefslogtreecommitdiff
path: root/test/pending/run/records.scala
blob: 0447b6f085d26f0fe7be3d88277c209401b19bca (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
24
25
trait C {
  def f: Int
}

object Test {
  type T = C {
    def f: Int
    def g: String
  }

  val x: T = new C {
    def f = 1
    def g = "hello"
  }

  val y = new C {
    def f = 2
    def g = " world"
  }

  val z: T = y

  Console.println(x.f+z.f+", expected = 3")
  Console.println(x.g+z.g+", expected = hello world")
}