Scala Programming Language
  1. Scala Programming Language
  2. SI-6318

ClassTag.unapply wrong for primitive types

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0-M7
    • Fix Version/s: Scala 2.10.0-M7
    • Component/s: None
    • Environment:

      Scala 2.10.0-M7, Java 7, Mac OS Mountain Lion

      Description

      tmp$ scala
      Welcome to Scala version 2.10.0-M7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_06).
      Type in expressions to have them evaluated.
      Type :help for more information.

      scala> import scala.reflect._
      import scala.reflect._

      scala> val intTag = implicitly[ClassTag[Int]]
      intTag: scala.reflect.ClassTag[Int] = ClassTag[int]

      scala> val n = 1
      n: Int = 1

      scala> intTag.runtimeClass.isAssignableFrom(n.getClass)
      res0: Boolean = true

      scala> intTag unapply n
      res1: Option[Int] = None

        Activity

        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/1265
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/commit/6a740332c7bfd56b20993be6ecd0bf818104f56c

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Heiko Seeberger
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development