summaryrefslogtreecommitdiff
path: root/test/files/pos/trait_fields_lambdalift.scala
blob: 62304a526854d99ea9194a12b68686e4cbe278b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Lift {
  def foo = {
    // this will be captured by the MouseHandler trait,
    // which gives rise to a new trait field during LambdaLift
    var Clicked = "Clicked"

    def bar = Clicked

    trait MouseHandler {
      def mouseClicked = Clicked + bar
    }

    class CC extends MouseHandler

    // new C {}
    (new CC).mouseClicked
  }
}

object O extends Lift with App {
  println(foo)
}