diff options
-rwxr-xr-x | test/files/run/existentials.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala index b6421bcbaf..a08a9da9b3 100755 --- a/test/files/run/existentials.scala +++ b/test/files/run/existentials.scala @@ -35,6 +35,21 @@ object LUB { def zzs: C[_ >: Int with java.lang.String] = z } +object Bug1189 { + case class Cell[T](x: T) + type U = Cell[T1] forSome { type T1 } + def f(x: Any): U = x match { case y: Cell[_] => y } + + var x: U = Cell(1) + println(x) + + println(f(x)) + + x = Cell("abc") + println(x) + println(f(x)) +} + object Test extends Application { def foo(x : Counter[T] { def name : String } forSome { type T }) = x match { |