summaryrefslogtreecommitdiff
path: root/test/files/pos/bug1565.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-02-18 19:59:28 +0000
committerPaul Phillips <paulp@improving.org>2009-02-18 19:59:28 +0000
commit36b0e8178f74a2986bce5c9027b9a2b22a4e7527 (patch)
tree2f9722a329ecc0f8745e66407f95824de71e02d3 /test/files/pos/bug1565.scala
parent0e04072c89052a6fc296b77df64f6501c36d0c92 (diff)
downloadscala-36b0e8178f74a2986bce5c9027b9a2b22a4e7527.tar.gz
scala-36b0e8178f74a2986bce5c9027b9a2b22a4e7527.tar.bz2
scala-36b0e8178f74a2986bce5c9027b9a2b22a4e7527.zip
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.
Diffstat (limited to 'test/files/pos/bug1565.scala')
-rw-r--r--test/files/pos/bug1565.scala18
1 files changed, 18 insertions, 0 deletions
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