diff options
-rw-r--r-- | test/files/pos/t9178.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t9178.scala | 13 |
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> + } +} |