Robert Jaros
04/09/2025, 1:01 PMKotlinNothingValueException
. Anyone experienced something like that? More in thread.Robert Jaros
04/09/2025, 1:03 PMfun toPlainObj(data: T): dynamic {
return if (jsonHelper == null || serializer == null) {
throw IllegalStateException("The data class can't be serialized. Please provide a serializer when creating the Tabulator instance.")
} else {
@Suppress("UnsafeCastFromDynamic")
JSON.parse(jsonHelper!!.encodeToString(serializer, data))
}
}
in 2.1.20 is translated to this code:
function (data) {
var tmp;
if (this.get_jsonHelper_i4zo3l_k$() == null || this.serializer_1 == null) {
throw IllegalStateException_init_$Create$("The data class can't be serialized. Please provide a serializer when creating the Tabulator instance.");
} else {
JSON.parse(ensureNotNull(this.get_jsonHelper_i4zo3l_k$()).encodeToString_k0apqx_k$(this.serializer_1, data));
throwKotlinNothingValueException();
}
return tmp;
};
turansky
04/09/2025, 1:53 PMdynamic
?ephemient
04/09/2025, 1:59 PMJSON.parse<Nothing>()
. it works if you explicitly write
JSON.parse<dynamic>()
or
JSON.parse<Any?>().asDynamic()
ephemient
04/09/2025, 1:59 PMRobert Jaros
04/09/2025, 2:29 PMfun toPlainObj(data: T): dynamic {
if (jsonHelper == null || serializer == null) {
throw IllegalStateException("The data class can't be serialized. Please provide a serializer when creating the Tabulator instance.")
}
@Suppress("UnsafeCastFromDynamic")
return JSON.parse(jsonHelper!!.encodeToString(serializer, data))
}
Robert Jaros
04/09/2025, 2:29 PMephemient
04/09/2025, 2:34 PMturansky
04/09/2025, 2:44 PMdynamic
usage 😉Robert Jaros
04/09/2025, 3:16 PMEdoardo Luppi
04/11/2025, 3:51 PM