I currently maintain Kotson, a Kotlin library that allows a kotlin-esque way of using Google's Gson.
In the library, I have several lines such as :
public val JsonElement.string : String get() = asString
Which is only a way to call .asString (.getAsString() in Java Gson) but with a returned String and not String!
Now, the IDE proposes to Kotson’s user both .asString: String! and .string: String. Which is not really ideal.
Is there a way I could modify the library so that kotson’s users use .asString but with strong nullability ?