I saw this question.
How can it be that with this line added
fun Int.toUpperCase() = ""
This problem
Error:(6, 16)
Overload resolution ambiguity:
@InlineOnly public inline fun Char.toUpperCase(): Char defined in kotlin.text
@InlineOnly public inline fun String.toUpperCase(): String defined in kotlin.text
goes away for this piece of code?
fun main(args: Array<String>){
var ab: String? = "hello"
ab = null
println(ab?.toUpperCase())
}
The answer given for the reference question makes sense, it just doesn't answer what is happening here.