amazon-ion / ion-element-kotlin

IonElement is an immutable in-memory representation of the Ion data format. IonElement's API is idiomatic to Kotlin.
Apache License 2.0
8 stars 7 forks source link

Change receiver type of `toIonValue` to `IonElement` #37

Closed dlurton closed 4 years ago

dlurton commented 4 years ago

A mild annoyance is that the toIonValue() extension function has AnyElement as it's receiver type. This means that in order to convert a non AnyElement IonElement to the legacy IonValue DOM, one must first call asAnyElement() on it.

Changing the reciever type to IonElement eliminates the need to do that without breaking source compatibility.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.