blob: 6050f3ff883ef179dd19e40d7e943d03abb12586 (
plain) (
tree)
|
|
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)
}
|