final class TypeString[T] extends AnyVal

Typeclass that contains string representation of a concrete type. This representation should correctly parse and typecheck when used as a type in Scala source code.

Instances of TypeString are implicitly macro-materialized. The macro will fail if the type contains references to local symbols, i.e. symbols that only exist in limited scope and cannot be referred to from any place in source code. This includes type parameters, this-references to enclosing classes, etc.

For example, the code below will NOT compile:

def listTypeRepr[T]: String = TypeString.of[List[T]]

because T is a local symbol that only has meaning inside its own method. However, if you provide external TypeString instance for T, the macro will pick it up and no longer complain:

def listTypeRepr[T: TypeString]: String = TypeString.of[List[T]]

Then, listTypeRepr[Int] will produce a string "List[Int]"

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TypeString
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TypeString(value: String)

Value Members

  1. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  2. def toString(): String
    Definition Classes
    TypeString → Any
  3. val value: String