koson icon indicating copy to clipboard operation
koson copied to clipboard

[BUG] Incorrect conversion of nullable ObjectType

Open nvkleban opened this issue 3 years ago • 0 comments

Describe the bug Nullable ObjectType uses wrong infix function String.to(value: Any?) that leads to incorrect output.

To Reproduce

val a: ObjectType? = obj { "a" to "a" }
val b = obj { "b" to a }
println(b) // prints {"b":"{\"a\":\"a\"}"}

Expected behavior Contract should probably be changed to String.to(value: ObjectType?) and work similar to other infix functions with nullable types.

nvkleban avatar Oct 20 '22 17:10 nvkleban