Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inferred bounded wildcard crashes the pickler #3856

Closed
scabug opened this issue Sep 20, 2010 · 3 comments
Closed

inferred bounded wildcard crashes the pickler #3856

scabug opened this issue Sep 20, 2010 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Sep 20, 2010

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)
@scabug
Copy link
Author

scabug commented Sep 20, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3856?orig=1
Reporter: @paulp

@scabug
Copy link
Author

scabug commented Sep 20, 2010

@paulp said:
...species of Type. Hey, they're all brothers under the skin.

@scabug
Copy link
Author

scabug commented Oct 16, 2010

@odersky said:
(In r23285) Closes #3614. Closes #3856. Refined handling of imports to avoid trees with null types in presentation compiler. Review by moors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants