summaryrefslogtreecommitdiff
path: root/test/files/pos/t5399.scala
blob: ebae7dbd9eaa4932f566fbad528f367b629e58b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class Test {
  class A[T]
  class B[T](val a: A[T])

  case class CaseClass[T](x: T)

  def break(existB: B[_]) =
    CaseClass(existB.a) match { case CaseClass(_) => }
}

class Foo {
  trait Init[T]
  class ScopedKey[T] extends Init[T]

  trait Setting[T] {
    val key: ScopedKey[T]
  }

  case class ScopedKey1[T](val foo: Init[T]) extends ScopedKey[T]

  val scalaHome: Setting[Option[String]] = null
  val scalaVersion: Setting[String] = null

  def testPatternMatch(s: Setting[_]) {
    s.key match {
      case ScopedKey1(scalaHome.key | scalaVersion.key) => ()
    }
  }
}

class Test2 {
  type AnyCyclic = Execute[Task]#CyclicException[_]

  trait Task[T]

  trait Execute[A[_] <: AnyRef] {
    class CyclicException[T](val caller: A[T], val target: A[T])
  }

  def convertCyclic(c: AnyCyclic): String =
    (c.caller, c.target) match {
      case (caller: Task[_], target: Task[_]) => "bazinga!"
    }
}