diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-06 10:30:58 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-09-06 10:30:58 -0700 |
commit | 930c85d6c96507d798d1847ea078eebf93dc0acb (patch) | |
tree | dcdcbe51a942026ef24e832f71bb91b9e36f7e4b /test/files/pos/t3577.scala | |
parent | 4f9851d1fdbad7c5584931935e138b16d20ac478 (diff) | |
parent | 00e46b3dbcea2b72fd3941b7ffc2efba382871e9 (diff) | |
download | scala-930c85d6c96507d798d1847ea078eebf93dc0acb.tar.gz scala-930c85d6c96507d798d1847ea078eebf93dc0acb.tar.bz2 scala-930c85d6c96507d798d1847ea078eebf93dc0acb.zip |
Merge pull request #1187 from retronym/ticket/3577
Better handling of BoundedWildcardType
Diffstat (limited to 'test/files/pos/t3577.scala')
-rw-r--r-- | test/files/pos/t3577.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/files/pos/t3577.scala b/test/files/pos/t3577.scala new file mode 100644 index 0000000000..80a280f67a --- /dev/null +++ b/test/files/pos/t3577.scala @@ -0,0 +1,29 @@ +case class Check[A](val value: A) + +case class C2(checks: Check[_]*); + +object C { + def m(x : C2): Any = (null: Any) match { + case C2(_, rest @ _*) => { + rest.map(_.value) + } + } +} + +/////////////////// + +object Container { + trait Exp[+T] + abstract class FuncExp[-S, +T] + + sealed abstract class FoundNode[T, Repr] { + def optimize[TupleT, U, That](parentNode: FlatMap[T, Repr, U, That]): Any + def optimize2[TupleT, U, That](parentNode: Any): Any + } + + class FlatMap[T, Repr, U, That] + + val Seq(fn: FoundNode[t, repr]) = Seq[FoundNode[_, _]]() + fn.optimize(null) // was: scala.MatchError: ? (of class BoundedWildcardType) @ Variances#varianceInType + fn.optimize2(null) // was: fatal error: bad type: ?(class scala.reflect.internal.Types$BoundedWildcardType) @ Pickle.putType +} |