Kotlin not able to convert gradle's Action class to a lambda
问题 So, while this is quite a kotlin-dsl for gradle specific issue, I think it overall applies to the kotlin language itself, so I am not going to use that tag. In the gradle API, the class Action<T> is defined as: @HasImplicitReceiver public interface Action<T> { /** * Performs this action against the given object. * * @param t The object to perform the action on. */ void execute(T t); } So ideally, this should work in kotlin (because it is a class with a SAM): val x : Action<String> = { println