summaryrefslogtreecommitdiff
path: root/test/files/detach-neg/det_bar.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2010-11-17 12:26:13 +0000
committermichelou <michelou@epfl.ch>2010-11-17 12:26:13 +0000
commitc09f6173e96ec741c9b38edfee969ae8c6b74d4e (patch)
tree1f06579f72afa12092acd0b5bbb7c678291cf619 /test/files/detach-neg/det_bar.scala
parent363a1456f671323b35dcacf2c8b8eb39180b8a53 (diff)
downloadscala-c09f6173e96ec741c9b38edfee969ae8c6b74d4e.tar.gz
scala-c09f6173e96ec741c9b38edfee969ae8c6b74d4e.tar.bz2
scala-c09f6173e96ec741c9b38edfee969ae8c6b74d4e.zip
updates Scala examples, added detach plugin
Diffstat (limited to 'test/files/detach-neg/det_bar.scala')
-rw-r--r--test/files/detach-neg/det_bar.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/detach-neg/det_bar.scala b/test/files/detach-neg/det_bar.scala
new file mode 100644
index 0000000000..1f4dd9e892
--- /dev/null
+++ b/test/files/detach-neg/det_bar.scala
@@ -0,0 +1,13 @@
+import scala.remoting._
+class A(y: Int) {
+ var z = 2
+ var bar = (x: Int) => x + y + z
+ def foo(x: Int): Int = x + y + z
+ bar = (x: Int) => x * y
+ detach(bar)
+}
+
+object test extends Application {
+ val a = new A(1)
+ println(a.bar(2))
+}