summaryrefslogtreecommitdiff
path: root/test/pending/pos/z1720.scala
blob: 6050f3ff883ef179dd19e40d7e943d03abb12586 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package test

class Thing {
  def info: Info[this.type] = InfoRepository.getInfo(this)
  def info2: Info[this.type] = {
    def self: this.type = this
    InfoRepository.getInfo(self)
  }
}

trait Info[T]
case class InfoImpl[T](thing: T) extends Info[T]

object InfoRepository {
  def getInfo(t: Thing): Info[t.type] = InfoImpl(t)
}