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.quoted/Type

Type

scala.quoted.Type
See theType companion class
objectType

Methods to interact with the currentType[T] in scope

Attributes

Companion
class
Source
Type.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
Type.type

Members list

Value members

Concrete methods

defshow[T <:AnyKind](usingType[T])(usingQuotes):String

Show a source code like representation of this type without syntax highlight

Show a source code like representation of this type without syntax highlight

Attributes

Source
Type.scala
defvalueOfConstant[T](usingType[T])(usingQuotes):Option[T]

Extracts the value of a singleton constant type. Returns Some of the value of the type if it is a singleton constant type. Returns None if the type is not a singleton constant type.

Extracts the value of a singleton constant type. Returns Some of the value of the type if it is a singleton constant type. Returns None if the type is not a singleton constant type.

Example usage:

import scala.deriving.*def f(using Quotes) = {  import quotes.reflect.*  val expr: Expr[Any] = ???expr match {  case '{ $mirrorExpr : Mirror.Sum { type MirroredLabel = label } } =>    Type.valueOfConstant[label] // Option[String]}}

Attributes

Source
Type.scala
defvalueOfTuple[T <:Tuple](usingType[T])(usingQuotes):Option[T]

Extracts the value of a tuple of singleton constant types. Returns Some of the tuple type if it is a tuple singleton constant types. Returns None if the type is not a tuple singleton constant types.

Extracts the value of a tuple of singleton constant types. Returns Some of the tuple type if it is a tuple singleton constant types. Returns None if the type is not a tuple singleton constant types.

Example usage:

import scala.deriving.*def f(using Quotes) = {  import quotes.reflect.*  val expr: Expr[Any] = ???expr match {  case '{ type label <: Tuple; $mirrorExpr : Mirror.Sum { type MirroredElemLabels = `label` } } =>    Type.valueOfTuple[label] // Option[Tuple]}}

Attributes

Source
Type.scala

Givens

Givens

givenof[T <:AnyKind](usingQuotes):Type[T]

Return a quoted.Type with the given type

Return a quoted.Type with the given type

Attributes

Source
Type.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp