bamboo
08/09/2016, 6:08 PMconfigure
that would take a variable number of arguments and a lambda with an implicit receiver to be useable like this:
configure(repositories, project.repositories) {
jcenter()
}
The closest I got was this:
fun <T: Any> configure(vararg ts: T): (T.() -> Unit) -> Unit =
{ configuration -> for (t in ts) t.configuration() }
configure(repositories, project.repositories)({
jcenter()
})
Note the ({ ... })
. Is there a better way?