You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We play with nullable types, eg: val a: String? inside our data class. However generated code as well as simple test snippet results in StackOverflowError:
"Nullable String element" {
val str: String? = "abc"
val js: Json = NullableEncoderInstance<String>(String.encoder()).run {
str.encode()
}
println(js)
}
It looks like NullableEncoderInstance cannot see encode extension function of the enclosed encoder:
override fun A?.encode(): Json =
this?.let { a -> encoderA().let { a.encode() } } ?: JsNull
The text was updated successfully, but these errors were encountered:
This looks like a shadowing error. It may be trying to get another extfun in a different context. It needs to be imported with a name such as import bla.encode as blaEncode, and then use a.blaEncode()
Hi,
We play with nullable types, eg:
val a: String?
inside our data class. However generated code as well as simple test snippet results in StackOverflowError:It looks like NullableEncoderInstance cannot see
encode
extension function of the enclosed encoder:The text was updated successfully, but these errors were encountered: