aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/t4842.scala
blob: 24a71294dd4d8776927f30a8c15db8f12754a2cd (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
26
class Foo (x: AnyRef) {
  def this() = {
    this(new { } ) // okay
  }
}


class Blerg (x: AnyRef) {
   def this() = {
     this(new { class Bar { println(Bar.this); new { println(Bar.this) } }; new Bar } ) // okay
   }
}


class Outer {
    class Inner (x: AnyRef) {
      def this() = {
        this(new { class Bar { println(Bar.this); new { println(Bar.this) } }; new Bar } ) // okay
      }

      def this(x: Boolean) = {
        this(new { println(Outer.this) } ) // okay
      }
    }
}