Zero, presumably, should only be displayed in this lowercase representation. As soon as you get the value from the array, it is "unpacked" into Unit:
scala> val units = new Array[Unit](5)
units: Array[Unit] = Array(null, null, null, null, null)
scala> units(0)
// note: no result
Compare with:
scala> val refs = new Array[AnyRef](5)
refs: Array[AnyRef] = Array(null, null, null, null, null)
scala> refs(0)
res0: AnyRef = null
There was such a discussion with Nothinginstead Unit.
source
share