Packages

object Unit extends AnyValCompanion

Annotations
@compileTimeOnly(message = "`Unit` companion object is not allowed in source; instead, use `()` for the unit value")
Source
Unit.scala
Linear Supertypes
AnyValCompanion, Specializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Unit
  2. AnyValCompanion
  3. Specializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def box(x: Unit): BoxedUnit

    Transform a value type into a boxed reference type.

    Transform a value type into a boxed reference type.

    This method is not intended for use in source code. The runtime representation of this value is platform specific.

    x

    the Unit to be boxed

    returns

    a scala.runtime.BoxedUnit offering x as its underlying value.

  2. def toString(): String

    The String representation of the scala.Unit companion object.

    The String representation of the scala.Unit companion object.

    returns

    a String representation of the object.

    Definition Classes
    Unit → AnyRef → Any
  3. def unbox(x: AnyRef): Unit

    Transform a boxed type into a value type.

    Transform a boxed type into a value type. Note that this method is not typesafe: it accepts any Object, but will throw an exception if the argument is not a scala.runtime.BoxedUnit.

    This method is not intended for use in source code. The result of successfully unboxing a value is ().

    x

    the scala.runtime.BoxedUnit to be unboxed.

    returns

    the Unit value ()

    Exceptions thrown

    ClassCastException if the argument is not a scala.runtime.BoxedUnit