Skip to content

inferred bounded wildcard crashes the pickler #3856

Closed
@scabug

Description

@scabug

See also #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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions