From 1cc06bb6976e2d211b6219cfa7cdfbaab193791e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 1 May 2007 14:01:18 +0000 Subject: more additions to checknull. --- test/files/neg/bug997.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 test/files/neg/bug997.scala (limited to 'test/files/neg/bug997.scala') diff --git a/test/files/neg/bug997.scala b/test/files/neg/bug997.scala new file mode 100755 index 0000000000..b6897e62df --- /dev/null +++ b/test/files/neg/bug997.scala @@ -0,0 +1,15 @@ +// An extractor with 2 results +object Foo { def unapply(x : String) = Some(Pair(x, x)) } + +object Test extends Application { + +// Prints 'x'; ought not to compile (or maybe a should be the Pair?). +"x" match { case Foo(a) => Console.println(a) } + +// Prints '(x,x)' as expected. +"x" match { case Foo(a, b) => Console.println((a,b)) } + +// Gives confusing error 'not found: value c'. +"x" match { case Foo(a, b, c) => Console.println((a,b,c)) } + +} -- cgit v1.2.3