From f902a988a09721e1c894f42544d25a51fe2801d1 Mon Sep 17 00:00:00 2001 From: David MacIver Date: Sun, 26 Oct 2008 10:21:47 +0000 Subject: Fix for ticket 1260. --- test/files/pos/t1260.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/files/pos/t1260.scala (limited to 'test/files/pos/t1260.scala') diff --git a/test/files/pos/t1260.scala b/test/files/pos/t1260.scala new file mode 100644 index 0000000000..b05259998e --- /dev/null +++ b/test/files/pos/t1260.scala @@ -0,0 +1,17 @@ +case class Foo(a: String, b: String) + +object Bar { + def unapply(s: String): Option[Long] = + try { Some(s.toLong) } catch { case _ => None } +} + +object Test { + def main(args: Array[String]) { + val f = Foo("1", "2") + f match { + case Foo(Bar(1), Bar(2)) => () + case Foo(Bar(i), Bar(j)) if i >= 0 => () + } + } +} + -- cgit v1.2.3