diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t7187.check | 6 | ||||
-rw-r--r-- | test/files/neg/t7187.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t7187.scala | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/test/files/neg/t7187.check b/test/files/neg/t7187.check new file mode 100644 index 0000000000..a30803c746 --- /dev/null +++ b/test/files/neg/t7187.check @@ -0,0 +1,6 @@ +t7187.scala:3: warning: Eta-expansion of zero-argument method values is deprecated. Did you intend to write EtaExpandZeroArg.this.foo()? + val f: () => Any = foo + ^ +error: No warnings can be incurred under -Xfatal-warnings. +one warning found +one error found diff --git a/test/files/neg/t7187.flags b/test/files/neg/t7187.flags new file mode 100644 index 0000000000..c6bfaf1f64 --- /dev/null +++ b/test/files/neg/t7187.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings diff --git a/test/files/neg/t7187.scala b/test/files/neg/t7187.scala new file mode 100644 index 0000000000..45d33f06af --- /dev/null +++ b/test/files/neg/t7187.scala @@ -0,0 +1,6 @@ +class EtaExpandZeroArg { + def foo(): () => String = () => "" + val f: () => Any = foo + + // f() would evaluate to <function0> instead of "" +} |