diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-08-11 11:07:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-11 11:07:48 +0200 |
commit | 910d2dbdb39288391441c009d802132350269fe6 (patch) | |
tree | e1ae789bf78dffdef4bfd746ea3a413c2c34934c /test/files/neg | |
parent | 961c8bea011559af65cfae9818d71ad35b6ecaf4 (diff) | |
parent | 43ba65fa11456899b3c45be14bd3895d8d6b6b5a (diff) | |
download | scala-910d2dbdb39288391441c009d802132350269fe6.tar.gz scala-910d2dbdb39288391441c009d802132350269fe6.tar.bz2 scala-910d2dbdb39288391441c009d802132350269fe6.zip |
Merge pull request #5327 from lrytz/2.12.x
SI-7187 deprecate eta-expansion of zero-arg method values
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 "" +} |