aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/functions1.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/functions1.scala')
-rw-r--r--tests/pos/functions1.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pos/functions1.scala b/tests/pos/functions1.scala
new file mode 100644
index 000000000..72686ca15
--- /dev/null
+++ b/tests/pos/functions1.scala
@@ -0,0 +1,13 @@
+class X(val elem: Int) extends Object {
+ def foo(y: String): Int = y.length + elem
+}
+
+object Functions {
+
+ val x = new X(2)
+ val xe = x.elem
+ val xf: String => Int = x.foo(_)
+ val x2: String => Int = x.foo
+ val x3 = x.foo _
+
+}