How to write a receiver function similar to kotlin in scala?

receiver function in kotlin

object App {
  fun <T> f(fn:App.() -> T):T{
    return fn(App)
  val name 
    get() = "App"
  fun main(args: Array<String>) {
    f { 
    }.let { println(it) }

It may help if you can explain what that code does and what is the use case you want to model in Scala.