Open toth-istvan-zoltan opened 2 months ago
I think the error is here, because instance is called in apply and the subencoder will be used by instance again.
instance
apply
override fun <T> polymorphic(fieldNumber: Int, fieldName: String, value: T, wireFormat: WireFormat<T>): WireFormatEncoder { val bytes = subEncoder.apply { string(1, "", wireFormat.wireFormatName) instance(2, "", value, wireFormat) }.pack() writer.bytes(fieldNumber, bytes) return this }
I think the error is here, because
instance
is called inapply
and the subencoder will be used by instance again.