scala.reflect

Type members

Classlikes

trait Enum extends Product with Serializable

A base trait of all Scala enum definitions

A base trait of all Scala enum definitions

trait Selectable extends Selectable

A class that implements structural selections using Java reflection.

A class that implements structural selections using Java reflection.

It can be used as a supertrait of a class or be made available as an implicit conversion via reflectiveSelectable.

In Scala.js, it is implemented using a separate Scala.js-specific mechanism, since Java reflection is not available.

Companion
object
object Selectable
Companion
class
@implicitNotFound(msg = "No TypeTest available for [${S}, ${T}]")
trait TypeTest[-S, T] extends Serializable

A TypeTest[S, T] contains the logic needed to know at runtime if a value of type S is an instance of T.

A TypeTest[S, T] contains the logic needed to know at runtime if a value of type S is an instance of T.

If a pattern match is performed on a term of type s: S that is uncheckable with s.isInstanceOf[T] and the pattern is one of the following forms:

  • t: T
  • t @ X() where X.unapply takes an argument of type T then a given instance of TypeTest[S, T] is summoned and used to perform the test.
Companion
object
object TypeTest
Companion
class

Types

type Typeable[T] = TypeTest[Any, T]

A shorhand for TypeTest[Any, T]. A Typeable[T] contains the logic needed to know at runtime if a value can be downcasted toT`.

A shorhand for TypeTest[Any, T]. A Typeable[T] contains the logic needed to know at runtime if a value can be downcasted toT`.

If a pattern match is performed on a term of type s: Any that is uncheckable with s.isInstanceOf[T] and the pattern are of the form:

  • t: T
  • t @ X() where the X.unapply has takes an argument of type T then a given instance of Typeable[T] (TypeTest[Any, T]) is summoned and used to perform the test.