```import kotlinx.serialization.StringFormat impor...
# codereview
a
Copy code
import kotlinx.serialization.StringFormat
import kotlinx.serialization.json.Json


private val format: StringFormat = Json { encodeDefaults = true }
object MyFormat : StringFormat by format
When I try to inline
format
the expression insists on referring to the class
Json
instead of the factory function
Json
Any tips to avoid the intermediate
format
variable?
e
Copy code
object MyFormat : StringFormat by (Json { encodeDefaults = true })