fun foo(@BuilderInference block: MutableList.() -> Unit): T = null!! fun takeString(s: String) {} fun test() { val s = foo { this.add("") } takeString(s) }