any

scala.compiletime.ops.any
object any

Attributes

Source
any.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
any.type

Members list

Type members

Types

type !=[X, Y] <: Boolean

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
type ==[X, Y] <: Boolean

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
type IsConst[X] <: Boolean

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
type ToString[X] <: String

String conversion of a constant singleton type.

String conversion of a constant singleton type.

import compiletime.ops.any._
val s1: ToString[1] = "1"
val sTrue: ToString[true] = "true"

Attributes

Source
any.scala