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

look at erased types when deciding things about arrays

    Details

      Description

      originally reported as SI-5904

      scala> trait LogLevelType
      defined trait LogLevelType
      
      scala> type LogLevel = Int with LogLevelType
      defined type alias LogLevel
      
      scala>  final val ErrorLevel = 1.asInstanceOf[Int with LogLevelType]
      ErrorLevel: Int with LogLevelType = 1
      
      scala> List(ErrorLevel, ErrorLevel)
      java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.Object;
              at .<init>(<console>:10)
      

        Activity

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1891
        Hide
        Adriaan Moors added a comment -

        "This started working after the merge fe1110f"

        Show
        Adriaan Moors added a comment - "This started working after the merge fe1110f"
        Hide
        Paul Phillips added a comment -

        For posterity, the exact commit in which this was fixed is 2b09d8caf5 .

        I use "exact" very loosely. "82 files changed, 1367 insertions, 1187 deletions"

        Show
        Paul Phillips added a comment - For posterity, the exact commit in which this was fixed is 2b09d8caf5 . I use "exact" very loosely. "82 files changed, 1367 insertions , 1187 deletions "

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Adriaan Moors
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development