From 9da23ec80f2046f2aac8de3e690376cf2af642d4 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 17 Nov 2015 16:17:35 +1000 Subject: SI-9178 Test for the status quo of eta-expansion to Func0 --- test/files/pos/t9178.flags | 1 + test/files/pos/t9178.scala | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/files/pos/t9178.flags create mode 100644 test/files/pos/t9178.scala (limited to 'test/files/pos') 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()) // + } +} -- cgit v1.2.3