Slackbot
08/16/2023, 6:26 PMVampire
08/16/2023, 7:29 PMgradle-8.2.1/subprojects/kotlin-dsl/src/main/kotlin/org/gradle/kotlin/dsl/NamedDomainObjectContainerExtensions.kt:329
where container.create(...)
is called which returns Configuration
.
The package where this method is in is annotated with org.gradle.api.NonNullApi
which is meta-annotated with org.jetbrains.annotations.NotNull
and javax.annotation.Nonnull
.
So I wonder whether not KT(IJ) should handle it as Configuration
instead of Configuration!
.Chris
08/16/2023, 7:42 PMval direct = configurations.create("direct")
Still leaves direct as Configuration!
Adam
08/16/2023, 10:02 PMT & Any
as the return type in this workaround resolves the warning for me:
import org.gradle.kotlin.dsl.getValue as getValueOriginal
operator fun <T> ExistingDomainObjectDelegate<out T>.getValue(receiver: Any?, property: KProperty<*>): T & Any =
getValueOriginal(receiver, property) as (T & Any)
val x by configurations.creating { } // no warning
Vampire
08/16/2023, 10:20 PMYep… IntelliJ is still warning if I call it directly:
Copy codeval direct = configurations.create("direct")
Still leaves direct asWell, it is not so sure what it thinks, here:Configuration!
Tapchicoma
08/17/2023, 12:22 PMPaul Merlin
09/05/2023, 3:16 PM