// "Create function 'foo'" "true" fun T.map(f: T.() -> U) = f() fun consume(s: String) {} fun test() { fun foo(i: Int): String { throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates. } consume(1.map(::foo)) }