class A { fun f1() {} } fun myA(func: A.() -> Unit) { A().func() } fun main() { myA foo@{ this@foo.f1() } }