joelpedraza
01/16/2019, 6:52 AMgildor
01/16/2019, 6:55 AMjoelpedraza
01/16/2019, 6:55 AMuser
01/16/2019, 11:16 AMvaskir
06/18/2020, 1:40 PMdave08
06/18/2020, 3:50 PMghedeon
06/18/2020, 11:04 PMthis::foo.getDelegate()
reflection call on a big scale? Let's say it's being called for almost every field in every UI class.
For the context, I'd want to observe property changes as an Observable stream, something like this:
fun <T : Any> KMutableProperty0<T>.observe(): Observable<T> = (getDelegate() as MyDelegate<T>).observe()
Va3000
06/19/2020, 1:57 PMGuy Bieber
06/19/2020, 7:59 PMelect
06/20/2020, 5:34 AMMutableMap::replaceAll
, I get
Symbol is declared in module 'java.base' which does not export package 'kotlin.collections'file is marked as red, but it compiles fine
Toddobryan
06/21/2020, 6:56 PMe: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (42,31) in …
Caused by: java.lang.IllegalStateException: No parameter with index 0-0 (name=reverser$module$1 access=16) in method scala.collection.TraversableOnce.reverser$2
Toddobryan
06/21/2020, 6:57 PMthis.args().tail()
Animesh Sahu
06/22/2020, 6:04 AMLoganDark
06/22/2020, 7:17 AMoverride
, it "overrides nothing"?LoganDark
06/22/2020, 8:27 AMuser
06/22/2020, 9:21 AMLoganDark
06/22/2020, 12:24 PMToddobryan
06/23/2020, 5:26 PMsikri
06/25/2020, 12:32 PMiex
06/25/2020, 12:42 PMuser
06/25/2020, 1:41 PMSeyed Jafari
06/25/2020, 8:11 PMinner class
reflectively using Kotlin-reflection library it's not hard except that I need to pass an instance of the parent class to the child class constructor.
Is there any function/way to get the KType
of parent class (without using it's name and Class.forName()
)?
here is an example of what I'm trying to achieve:
class Parent {
inner class Child()
}
fun main() {
val childType: KType = typeOf<Parent.Child>()
val parentType = childType.getParent()
}
Justin
06/25/2020, 10:18 PMannotation class DynamicAnnotation(val type: String)
that somehow applies one of two existing annotations based on the passed type parameter?
Specifically, I want to do something like this:
val annotation = "Serializable" // or, "JsExport"
@DynamicAnnotation(annotation)
data class User(val id: String)
...such that when the annotation
string is set to "JsExport"
, it will generate:
@JsExport data class User(val id: String)
And when it's set to "Serializable"
, it will generate:
@Serializable data class User(val id: String)
This is to deal with a known bug in Kotlin 1.4-M2 and kotlinx.serialization (you can't have classes annotated with Serializable and JsExport for some reason).
Any ideas?Michael de Kaste
06/26/2020, 2:15 PMasad.awadia
06/26/2020, 2:16 PMuser
06/26/2020, 2:35 PMJoakim Tengstrand
06/26/2020, 4:08 PMJoakim Tengstrand
06/26/2020, 6:40 PM