Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.compiletime/scala.compiletime.ops/any

any

scala.compiletime.ops.any
objectany

Attributes

Source
any.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
any.type

Members list

Type members

Types

infixtype!=[X,Y] <:Boolean

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" = false

Attributes

Source
any.scala
infixtype==[X,Y] <:Boolean

Equality 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" = true

Attributes

Source
any.scala
typeIsConst[X] <:Boolean

Tests 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] = false

If 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

Attributes

Source
any.scala
typeToString[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
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp