import scala.tools.partest._

object Test extends DirectTest {

  override def extraSettings: String = "-usejavacp -Vprint-pos -Vprint:patmat -Ystop-after:patmat"

  override def code =
    """
    |class C {                                                                                        //
    |  def commonSubPattern(x: Any) = {                                                               //
    |    (x:  @unchecked) match {                                                                     //
    |      case _: Option[_] =>                                                                       //
    |      case s: String if s == "4" =>                                                              //
    |         s.hashCode                                                                              //
    |      case s: String if s == "6" =>                                                              //
    |         s.hashCode                                                                              //
    |    }                                                                                            //
    |  }                                                                                              //
    |  def extractor(x: Any) = (x: @unchecked) match {                                                //
    |      case Product2(a, b) =>                                                                     //
    |         a                                                                                       //
    |    }                                                                                            //
    |  def swatch = {                                                                                 //
    |    try {                                                                                        //
    |      toString                                                                                   //
    |    } catch {                                                                                    //
    |      case t: Throwable                                                                          //
    |        if "".isEmpty =>                                                                         //
    |           t.toString                                                                            //
    |    }                                                                                            //
    |  }                                                                                              //
    |}
    |""".stripMargin

  override def show(): Unit = compile()
}
