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

inferred bounded wildcard crashes the pickler

    Details

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

      Description

      See also SI-3577. In both tickets BoundedWildcardTypes are reaching pattern matches which are not expected them. We will play whack a mole with this sort of thing for the rest of our lives unless we can document and start enforcing a few invariants about when each species of tree is supposed to exist and what its hunting ground is supposed to be.

      scala> case class C[T](x: T) 
      defined class C
      
      scala> case class CS(xs: C[_]*)
      defined class CS
      
      scala> CS(C(5), C("abc")) match { case CS(C(5), xs @ _*) => xs }
      Exception in thread "main" scala.tools.nsc.FatalError: bad type: ?>: Nothing <: Any(class scala.tools.nsc.symtab.Types$$BoundedWildcardType)
      	at scala.tools.nsc.symtab.classfile.Pickler$$Pickle.scala$$tools$$nsc$$symtab$$classfile$$Pickler$$Pickle$$$$putType(Pickler.scala:215)
      	at scala.tools.nsc.symtab.classfile.Pickler$$Pickle$$$$anonfun$$putTypes$$1.apply(Pickler.scala:218)
      	at scala.tools.nsc.symtab.classfile.Pickler$$Pickle$$$$anonfun$$putTypes$$1.apply(Pickler.scala:218)
      	at scala.collection.LinearSeqOptimized$$class.foreach(LinearSeqOptimized.scala:61)
      	at scala.collection.immutable.List.foreach(List.scala:45)
      	at scala.tools.nsc.symtab.classfile.Pickler$$Pickle.putTypes(Pickler.scala:218)
      	at scala.tools.nsc.symtab.classfile.Pickler$$Pickle.scala$$tools$$nsc$$symtab$$classfile$$Pickler$$Pickle$$$$putType(Pickler.scala:182)
      	at scala.tools.nsc.symtab.classfile.Pickler$$Pickle.scala$$tools$$nsc$$symtab$$classfile$$Pickler$$Pickle$$$$putType(Pickler.scala:205)
      

        Activity

        Hide
        Paul Phillips added a comment -

        ...species of Type. Hey, they're all brothers under the skin.

        Show
        Paul Phillips added a comment - ...species of Type. Hey, they're all brothers under the skin.
        Hide
        Martin Odersky added a comment -

        (In r23285) Closes SI-3614. Closes SI-3856. Refined handling of imports to avoid trees with null types in presentation compiler. Review by moors

        Show
        Martin Odersky added a comment - (In r23285) Closes SI-3614 . Closes SI-3856 . Refined handling of imports to avoid trees with null types in presentation compiler. Review by moors

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development