louiscad
01/02/2019, 11:12 PMexecute()
extension function to execute a string as a command. Is there a similar extension for vanilla Kotlin that I can include in a kotlin script that doesn't depend on Gradle?elect
06/09/2021, 10:20 AMuser
06/09/2021, 11:33 AMuser
06/09/2021, 2:50 PMuser
06/09/2021, 4:08 PMuser
06/10/2021, 8:23 AMuser
06/10/2021, 9:48 AMuser
06/10/2021, 12:30 PMuser
06/10/2021, 3:00 PMuser
06/10/2021, 4:30 PMErik
06/11/2021, 10:11 AMandroid { kotlinOptions { languageVersion = "1.5" } }
in my module's build.gradle file?
Also, I wonder if this feature is documented somewhere (and where, of course).
fun a(b: () -> Unit): Unit = TODO()
fun f(): Any? = TODO()
val p = a(::f) // OK
val g: KFunction0<Any?> = ::f
val q = a(g) // Fails: The feature "unit conversion" is disabled
val h: () -> Any? = ::f
val r = a(h) // Fails: The feature "unit conversion" is disabled
user
06/11/2021, 1:29 PMuser
06/11/2021, 3:43 PMXy Ren
06/12/2021, 10:21 AMuser
06/12/2021, 5:29 PMuser
06/13/2021, 12:34 PMDavid Smith
06/14/2021, 10:56 AMsealed class Parent() {
data class Child(val value : String) : Parent()
}
data class Other(val value : Parent)
val child = Child("something")
Other(child as Parent)
I get an “Unchecked cast” warning. How is this so, surely the compiler knows that the Child
is also a Parent
?David Smith
06/14/2021, 11:00 AMuser
06/14/2021, 4:29 PMuser
06/15/2021, 1:53 PMuser
06/15/2021, 4:00 PMuser
06/15/2021, 6:35 PMuser
06/16/2021, 1:51 PMuser
06/16/2021, 7:16 PMSol Tig
06/17/2021, 4:41 AMuser
06/17/2021, 2:04 PMuser
06/17/2021, 4:00 PMuser
06/17/2021, 4:33 PMuser
06/17/2021, 6:07 PMUbinyou
06/18/2021, 1:51 PM