any
scala.compiletime.ops.any$
object any
Attributes
Members list
Type members
Types
Inequality comparison of two singleton types.
Inequality comparison of two singleton types.
import compiletime.ops.any._
val eq1: 1 != 1 = false
val eq2: 1 != "1" = true
val eq3: "1" != "1" = false
Attributes
- Source
- any.scala
Equality comparison of two singleton types.
Equality comparison of two singleton types.
import compiletime.ops.any._
val eq1: 1 == 1 = true
val eq2: 1 == "1" = false
val eq3: "1" == "1" = true
Attributes
- Source
- any.scala
Tests if a type is a constant.
Tests if a type is a constant.
import compiletime.ops.any._
val c1: IsConst[1] = true
val c2: IsConst["hi"] = true
val c3: IsConst[false] = true
val c4: IsConst[Any] = false
If the type is not yet known, then IsConst
remains unevaluated, and will be evaluated only at its concrete type application. E.g.:
import compiletime.ops.any._
//def `isConst`` returns the type `IsConst[X]`, since `X` is not yet known.
def isConst[X] : IsConst[X] = ???
val c5 : true = isConst[1] //now the type is known to be a constant
val c6 : false = isConst[Any] //now the type is known to be not a constant
Attributes
- Source
- any.scala
In this article