summaryrefslogtreecommitdiff
path: root/test/files/detach-neg/det_bar.scala
diff options
context:
space:
mode:
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))
+}