aboutsummaryrefslogblamecommitdiff
path: root/tests/invalid/pos/t3577.scala
blob: e94b69b4b3abc2dfe09d9c13117e62dcf0fddee7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10





                                          
                              


                                                                               





















                                                                                                                              
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 : _*) => {
    // Invalid: Vararg pattern cannot be split between normal and :_* patterns.
    // This split also does not work for vararg arguments, so there's no
    // good argument it should work for patterns
      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
}