aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/t6231.scala
blob: 1e5b4e0e1a1622a298f252bd1c3c046feb25ac1a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                          
object Bug {
  def bar(ev: Any) = {
    trait X {
      def qux = { () => ev }
    }
    new X {}.qux()

    // workaround
    trait Y {
      val ev2 = ev // manually capture `ev` so that `ev2` is added to the trait interface.
      def qux = { () => ev2 }
    }
  }
}