Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Pattern Matcher
    • Labels:
      None

      Description

      Looks like it only crashes in the repl for some reason. There has to be a superclass with a val.

      scala> class Color(val red: Int)
      defined class Color
      
      scala> case class Red(r:Int) extends Color(r)
      defined class Red
      
      scala> def f(c: Any) = c match { case Red(_) => () }
      Exception in thread "main" java.lang.IndexOutOfBoundsException
      	at scala.collection.LinearSeqOptimized$$class.apply(LinearSeqOptimized.scala:53)
      	at scala.collection.immutable.List.apply(List.scala:45)
      	at scala.tools.nsc.matching.Matrix$$MatrixContext$$PatternVarGroup.apply(Matrix.scala:184)
      	at scala.tools.nsc.matching.ParallelMatching$$MatchMatrix.classifyPat$$1(ParallelMatching.scala:74)
      	at scala.tools.nsc.matching.ParallelMatching$$MatchMatrix$$$$anonfun$$1$$$$anonfun$$apply$$1.apply(ParallelMatching.scala:76)
      	at scala.tools.nsc.matching.ParallelMatching$$MatchMatrix$$$$anonfun$$1$$$$anonfun$$apply$$1.apply(ParallelMatching.scala:76)
      	at scala.Function2$$$$anonfun$$tupled$$1.apply(Function2.scala:50)
        ...
      

        Activity

        Hide
        Adriaan Moors added a comment -

        repl and pattern matcher? �that's probably for mr. extempore, n�

        Show
        Adriaan Moors added a comment - repl and pattern matcher? �that's probably for mr. extempore, n�
        Hide
        Paul Phillips added a comment -

        Blast it, why don't I think of these things BEFORE opening the ticket.

        Show
        Paul Phillips added a comment - Blast it, why don't I think of these things BEFORE opening the ticket.
        Hide
        Jason Zaugg added a comment -

        Closing pending the merge of:

        https://github.com/scala/scala/pull/540

        Not sure when it was fixed.

        Show
        Jason Zaugg added a comment - Closing pending the merge of: https://github.com/scala/scala/pull/540 Not sure when it was fixed.

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Paul Phillips
            TracCC:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development