aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/structural.scala
blob: 8afa49ed0e0b8d62b19000a7943d4752b30e9df2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
object test123 {
  type A = { def a: Int }
  def f(a: A): A = a
}

object structural2 {
  type A = { def a: Int }

  type B = {
    def b: Int
  }

  type AB = A & B

  def f(ab: AB): AB = ab

  f(new {
    def a = 43
    def b = 42
  })
}