While reviewing a code change I found Array.empty
not Array()
that I would consider more idiomatic. I was then surprised to have learnt that ==
them gives false
yet they appear equal type- and value-wise.
scala> Array.empty == Array()
res1: Boolean = false
scala> Array.empty
res2: Array[Nothing] = Array()
scala> Array()
res3: Array[Nothing] = Array()
Could anyone explain why is so?