From 36b0e8178f74a2986bce5c9027b9a2b22a4e7527 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 18 Feb 2009 19:59:28 +0000 Subject: Fix and test case for #1565; an anonymous funct... Fix and test case for #1565; an anonymous function can now be used as a statement (primarily for use in the interpreter) unless it cannot be distinguished from a self-type declaration. --- test/files/pos/bug1565.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/files/pos/bug1565.scala (limited to 'test/files/pos') diff --git a/test/files/pos/bug1565.scala b/test/files/pos/bug1565.scala new file mode 100644 index 0000000000..9a5bfd0882 --- /dev/null +++ b/test/files/pos/bug1565.scala @@ -0,0 +1,18 @@ +object Bug1565 { + object X0 { 0; (a : Int, b : Int, c : Int) => println(List(a, b)) } + def x() = { 0; (a : Int, b : Int) => println(List(a, b)) ; 0 } + + (a : Int, b : Int) => println(List(a, b)) + + // various function syntaxes to exercise the parser + val xs = List(1,2,3) + xs.filter(x => x < 2) + xs.filter((x) => x < 2) + xs.filter { x => x < 2 } + xs.filter { _ < 2 } + xs.filter (_ < 2) + xs.foreach { e => + val buf0 = e + 1 + buf0 + } +} \ No newline at end of file -- cgit v1.2.3