According to the docs, ===
performs referential equality.
Given the following referential equality comparisons, this doesn't seem to work in all cases:
val x = "A"
val y = "A"
println(x === y) // "true"
println("A" === "A") // "true"
I would expect both of those cases to return false.
Yet this example returns false as expected:
val x = readLine()!! // "A"
val y = readLine()!! // "A"
println(x === y) // "false"
So why does referential equality comparison work for the latter case, but not the former?