diff options
author | Martin Odersky <odersky@gmail.com> | 2012-06-02 23:09:27 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-06-02 23:09:34 +0200 |
commit | fc24db4ca25c66a7d04ae2d225e5b430e9c599dd (patch) | |
tree | 3005301b419cdecfad036334e0c7697c1edf11e0 /test | |
parent | 85cd96da352c929ea0ce4ba236730579e09c5c4b (diff) | |
download | scala-fc24db4ca25c66a7d04ae2d225e5b430e9c599dd.tar.gz scala-fc24db4ca25c66a7d04ae2d225e5b430e9c599dd.tar.bz2 scala-fc24db4ca25c66a7d04ae2d225e5b430e9c599dd.zip |
Closes t5399. Review by adriaanm
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t5399.scala | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/files/pos/t5399.scala b/test/files/pos/t5399.scala new file mode 100644 index 0000000000..ebae7dbd9e --- /dev/null +++ b/test/files/pos/t5399.scala @@ -0,0 +1,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!" + } +} + |