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

value class. class tag: crash. class manifest: crash.

    Details

      Description

      Note two distinct crash points. Regression from 2.9.

      object Test {
        // This one crashes in superaccessors
        def f1 = classManifest[Predef.ArrowAssoc[_]]
        // This one crashes in jvm
        def f2 = classTag[Predef.ArrowAssoc[_]]
      
        // f1:
        //
        // error: Unknown type: Predef$ArrowAssoc$unboxed, Predef$ArrowAssoc$unboxed [class scala.reflect.internal.Types$UniqueErasedValueType, class scala.reflect.internal.Types$UniqueErasedValueType] TypeRef? false
      
        // f2:
        //
        // TRANSFORM: null
        // TREE: reflect.this.ClassManifest.<error>[ArrowAssoc[_]](classOf[scala.Predef$$ArrowAssoc].asInstanceOf[Class[ArrowAssoc[_]]], reflect.this.NoManifest)
        // TRANSFORM: null
        // TREE: scala.this.Predef.classManifest[ArrowAssoc[_]](reflect.this.ClassManifest.<error>[ArrowAssoc[_]](classOf[scala.Predef$$ArrowAssoc].asInstanceOf[Class[ArrowAssoc[_]]], reflect.this.NoManifest))
        // TRANSFORM: a.scala
      }
      

        Activity

        Hide
        Paul Phillips added a comment -

        Also, it doesn't crash with a non-wildcard in the type parameter position, and typeTag does and doesn't crash the same way.

        scala> classTag[scala.Predef.ArrowAssoc[String]]
        res0: ClassTag[ArrowAssoc[String]] = ClassTag[class scala.Predef$ArrowAssoc]
        
        scala> typeTag[scala.Predef.ArrowAssoc[_]]
        ReplGlobal.abort: Unknown type: Predef$ArrowAssoc$unboxed, Predef$ArrowAssoc$unboxed [class scala.reflect.internal.Types$UniqueErasedValueType, class scala.reflect.internal.Types$UniqueErasedValueType] TypeRef? false
        error: Unknown type: Predef$ArrowAssoc$unboxed, Predef$ArrowAssoc$unboxed [class scala.reflect.internal.Types$UniqueErasedValueType, class scala.reflect.internal.Types$UniqueErasedValueType] TypeRef? false
        
        Show
        Paul Phillips added a comment - Also, it doesn't crash with a non-wildcard in the type parameter position, and typeTag does and doesn't crash the same way. scala> classTag[scala.Predef.ArrowAssoc[String]] res0: ClassTag[ArrowAssoc[String]] = ClassTag[class scala.Predef$ArrowAssoc] scala> typeTag[scala.Predef.ArrowAssoc[_]] ReplGlobal.abort: Unknown type: Predef$ArrowAssoc$unboxed, Predef$ArrowAssoc$unboxed [class scala.reflect.internal.Types$UniqueErasedValueType, class scala.reflect.internal.Types$UniqueErasedValueType] TypeRef? false error: Unknown type: Predef$ArrowAssoc$unboxed, Predef$ArrowAssoc$unboxed [class scala.reflect.internal.Types$UniqueErasedValueType, class scala.reflect.internal.Types$UniqueErasedValueType] TypeRef? false
        Show
        Adriaan Moors added a comment - https://github.com/scala/scala/pull/933

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development