summaryrefslogtreecommitdiff
path: root/test/files/pos/t9178.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/t9178.scala')
-rw-r--r--test/files/pos/t9178.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/pos/t9178.scala b/test/files/pos/t9178.scala
new file mode 100644
index 0000000000..f2cf20a778
--- /dev/null
+++ b/test/files/pos/t9178.scala
@@ -0,0 +1,13 @@
+// eta expansion to Function0 is problematic (as shown here).
+// Perhaps we should we deprecate it? See discussion in the comments of
+// on SI-9178.
+//
+// This test encodes the status quo: no deprecation.
+object Test {
+ def foo(): () => String = () => ""
+ val f: () => Any = foo
+
+ def main(args: Array[String]): Unit = {
+ println(f()) // <function0>
+ }
+}