Tóth István Zoltán
05/09/2024, 12:31 PMdynamic
is not supported by the JVM backend. Would it be acceptable to have it replaced by an IR plugin? I would use it in the context of data serialization: Any
would mean polymorphic serialization, dynamic
would mean "there is something but we don't really know what". As I understand the meaning of dynamic
it is exactly this.
In this example signature
describes what's in default
.
@Adat
class AdaptiveTemplateVariable(
val name: String,
val index: Int,
val signature: String,
val default : dynamic
)
jw
05/09/2024, 12:47 PMAdam S
05/09/2024, 5:18 PMThat's simply not possible on the JVMdoesn't Groovy demonstrate it is possible?
jw
05/09/2024, 5:25 PMdynamic
which emits regular JS.Tóth István Zoltán
05/09/2024, 6:17 PMdynamic
. I want the source code to contain dynamic
and the replace it with an IR plugin. My question is: does this goes agains some rule?Adam S
05/10/2024, 8:34 AMdynamic
you're proposing similar to a generic type? Or an expect/actual? Would the possible values of dynamic
be limited to a subset of types?Adam S
05/10/2024, 8:36 AM@Adat
class AdaptiveTemplateVariable(
val signature: String,
val default : dynamic
)
fun main() {
val v = AdaptiveTemplateVariable(signature = "kotlin.String", default = "x")
}
Tóth István Zoltán
05/10/2024, 8:56 AM