summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-11-17 16:17:35 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-11-17 16:17:35 +1000
commit9da23ec80f2046f2aac8de3e690376cf2af642d4 (patch)
tree567e2410ad69f456d8b292d9817bb38a7c943d11 /test/files/pos
parent639e52ae7e128025f6eb57957a590b808d83a9a4 (diff)
downloadscala-9da23ec80f2046f2aac8de3e690376cf2af642d4.tar.gz
scala-9da23ec80f2046f2aac8de3e690376cf2af642d4.tar.bz2
scala-9da23ec80f2046f2aac8de3e690376cf2af642d4.zip
SI-9178 Test for the status quo of eta-expansion to Func0
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t9178.flags1
-rw-r--r--test/files/pos/t9178.scala13
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/pos/t9178.flags b/test/files/pos/t9178.flags
new file mode 100644
index 0000000000..7de3c0f3ee
--- /dev/null
+++ b/test/files/pos/t9178.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -deprecation
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>
+ }
+}