cats.NotNull
See theNotNull companion object
An instance of NotNull[A]
indicates that A
does not have a static type
of Null
.
This can be useful in preventing Null
from being inferred when a type
parameter is omitted.
This trait is used along with ambiguous implicits to achieve the goal of
preventing inference of Null
. This ambiguous implicit trick has been used
in the Scala community for some time. Here
is an early example of such a trick being used in a similar way to prevent a
Nothing
type.
Attributes
- Companion:
- object
- Source:
- NotNull.scala
- Graph
- Supertypes