Why do you need a lattice in Scala?

I heard someone say:

"Scala uses a type lattice, not a type hierarchy that is different from Java."

I don't quite understand what a value type lattice is and what is the main difference between a type hierarchy and a type hierarchy.

Can someone explain this term to me?

+3


source to share


1 answer


In essence, this means that: The type hierarchy for Scala is a lattice, that is, it has "bottom" as well as "top".

enter image description here



As you can see from the image, the top type is here Any

and the bottom one is Nothing

.

+6


source







All Articles