From 8eed99684f2a351ee6d6db28899204c3f4ef7d73 Mon Sep 17 00:00:00 2001 From: michelou Date: Mon, 2 Jul 2007 11:31:50 +0000 Subject: added bug 1189 to run/existentials.scala --- test/files/run/existentials.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/files') 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 { -- cgit v1.2.3