intellij informs me that i could convert the follo...
# gradle
t
intellij informs me that i could convert the following into a lambda (what i'd really like to do):
Copy code
tasks.withType(Test::class).configureEach(object : Action<Test> {
        override fun execute(it: Test) {
            it.outputs.upToDateWhen { false }
        }
    })
Yet when i do it manually or let intellij do it for with following result:
Copy code
tasks.withType(Test::class).configureEach {
        it.outputs.upToDateWhen { false }
    }
It complains that
it
is undefined. Any idea why?
k
configureEach
takes
T.() -> Unit
, so you can just do
outputs.upToDateWhen { ... }
without the
it
t
ahh! indeed! thank you! But "Got to delcaration" is REALLY misleading here, because it leads to the variant of
configureEach
that takes an
Action
as argument 😕
l
All
Action
lambdas in Gradle use receiver instead of
it
.
t
ah! good to know, thanks
l
I think you can see
@ImplicitReceiver
annotations on such types.