org.scalautils

AsAny

object AsAny extends AsAny

Companion object to trait AsAny that facilitates the importing of AsAny members as an alternative to mixing it in. One use case is to import AsAny members so you can use them in the Scala interpreter:

$ scala -classpath scalatest.jar
Welcome to Scala version 2.10.0
Type in expressions to have them evaluated.
Type :help for more information.

scala> import org.scalatest._ import org.scalatest._

scala> import Matchers._ import Matchers._

scala> Set(1, "2") should contain (1) <console>:14: error: overloaded method value should with alternatives: [R](inv: org.scalautils.TripleEqualsInvocation[R])(implicit constraint: org.scalautils.EqualityConstraint[scala.collection.immutable.Set[Any],R])Unit <and> (notWord: org.scalatest.Matchers.NotWord)org.scalatest.Matchers.ResultOfNotWordForTraversable[Any,scala.collection.immutable.Set] <and> (beWord: org.scalatest.Matchers.BeWord)org.scalatest.Matchers.ResultOfBeWordForAnyRef[scala.collection.GenTraversable[Any]] <and> (containMatcher: org.scalatest.ContainMatcher[Any])Unit <and> (containWord: org.scalatest.Matchers.ContainWord)org.scalatest.Matchers.ResultOfContainWordForTraversable[Any] <and> (haveWord: org.scalatest.Matchers.HaveWord)org.scalatest.Matchers.ResultOfHaveWordForTraversable[Any] <and> (rightMatcherGen1: org.scalatest.Matchers.MatcherGen1[scala.collection.immutable.Set[Any],org.scalautils.Equality])(implicit equality: org.scalautils.Equality[scala.collection.immutable.Set[Any]])Unit <and> (rightMatcherX6: org.scalatest.matchers.Matcher[scala.collection.GenTraversable[Any]])Unit cannot be applied to (org.scalatest.matchers.Matcher[scala.collection.GenTraversable[Int]]) Set(1, "2") should contain (1) ^

scala> Set(1, "2") should contain (1.asAny)

scala>

Linear Supertypes
AsAny, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AsAny
  2. AsAny
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. class AsAnyWrapper extends AnyRef

    Wrapper class with an asAny method that returns the passed object as type Any.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. implicit def convertToAsAnyWrapper(o: Any): AsAnyWrapper

    Implicit conversion that adds an asAny method to an object, which returns the exact same object but as type Any.

    Implicit conversion that adds an asAny method to an object, which returns the exact same object but as type Any.

    Definition Classes
    AsAny
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  19. def toString(): String

    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  21. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  22. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AsAny

Inherited from AnyRef

Inherited from Any

Ungrouped