aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i2064.scala
blob: 90992337271e4ec8b47e00aec215f54599f1ebb1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
object p {

class Foo[T] {
  // Crashes:
  def f(): Foo[T] = (if (true) this else this).bar

  // Works:
  // def f(): Foo[T] = new Bar(if (true) this else this).bar
}

implicit class Bar[A](val self: A) {
  def bar(): A = self
}

}