Hello, guys! There is a function ```fun Dependency...
# gradle
i
Hello, guys! There is a function
Copy code
fun DependencyHandler.kotlin(module: String, version: String? = null): Any =
    "org.jetbrains.kotlin:kotlin-$module${version?.let { ":$version" } ?: ""}"
Why does it return Any? It becomes a problem when I use this overload of
implementation
:
Copy code
implementation(kotlin("...")) { isTransitive = false }
In this variant,
implementation
takes
String
as a first argument and I need to explicitely cast return value to
String
o
https://github.com/gradle/gradle/issues/12172 is a reported issue doesn't contain a reason though
i
Thanks!
g
If you can be certain that the return type is actually a string, you might as well do
implementation(kotlin("...").toString())
i
Of course, but it's not too safe from API perspective)