Inequality comparison of two singleton types.
Inequality comparison of two singleton types.
import compiletime.ops.any.*val eq1: 1 != 1 = falseval eq2: 1 != "1" = trueval eq3: "1" != "1" = falseEquality comparison of two singleton types.
Equality comparison of two singleton types.
import compiletime.ops.any.*val eq1: 1 == 1 = trueval eq2: 1 == "1" = falseval eq3: "1" == "1" = trueTests if a type is a constant.
Tests if a type is a constant.
import compiletime.ops.any.*val c1: IsConst[1] = trueval c2: IsConst["hi"] = trueval c3: IsConst[false] = trueval c4: IsConst[Any] = falseIf the type is not yet known, thenIsConst 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 constantval c6 : false = isConst[Any] //now the type is known to be not a constant