Clone
Rodrigo B. de Oliveira
committed
on 03 Oct 19
Prefer `Action<T>` over `T.() -> Unit` for the Kotlin script API
From the perspective of an user of the API both types are effectively
the s… Show more
Prefer `Action<T>` over `T.() -> Unit` for the Kotlin script API

From the perspective of an user of the API both types are effectively

the same.

From a compile time and runtime perspective `Action<T>` seems a better

choice as values can be passed to the core Gradle API directly.

From an API consistency point of view `Action<T>` also looks like the

superior choice as it is more consistent with the rest of the Gradle

API.

And finally, from an user education perspective, `KotlinScript`

provides a clear opportunity for users to understand the equivalence

between `Action<T>` and `T.() -> Unit`.

Show less

master + 254 more