diff options
author | Martin Odersky <odersky@gmail.com> | 2007-02-20 18:03:29 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-02-20 18:03:29 +0000 |
commit | 45bcd02f6ba099277bedbf83ec2bda07435c7797 (patch) | |
tree | 559f799a725f8ec403e5a3db6ced5c695349df2b /test | |
parent | 5db82b1e48cb2cdb98e5b3826e1439b9c80d17bd (diff) | |
download | scala-45bcd02f6ba099277bedbf83ec2bda07435c7797.tar.gz scala-45bcd02f6ba099277bedbf83ec2bda07435c7797.tar.bz2 scala-45bcd02f6ba099277bedbf83ec2bda07435c7797.zip |
now allows & for by-name params and parameters ...
now allows & for by-name params and parameters methods.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/amp.check | 3 | ||||
-rw-r--r-- | test/files/run/amp.scala | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/amp.check b/test/files/run/amp.check new file mode 100644 index 0000000000..44be9395cb --- /dev/null +++ b/test/files/run/amp.check @@ -0,0 +1,3 @@ +g called +42 +1 diff --git a/test/files/run/amp.scala b/test/files/run/amp.scala new file mode 100644 index 0000000000..62451b62ba --- /dev/null +++ b/test/files/run/amp.scala @@ -0,0 +1,19 @@ +object Test extends Application { + + def foo() = { + def f: int = 1 + val x = &f + x + } + + def bar(g: => int) = { + &g + } + + Console.println((bar{ Console.println("g called"); 42 })()) + Console.println(foo()()) + +} + + + |