diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-30 22:44:17 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-30 22:44:17 -0700 |
commit | 5d7d64482011f72596a634a58138e253b7fe3531 (patch) | |
tree | f9c9e2e92442c8f6927b7331cc8d19f286c765d4 /test/files | |
parent | 8e32d00e1679114ee1b3f9a90f235d2ab9feba2e (diff) | |
download | scala-5d7d64482011f72596a634a58138e253b7fe3531.tar.gz scala-5d7d64482011f72596a634a58138e253b7fe3531.tar.bz2 scala-5d7d64482011f72596a634a58138e253b7fe3531.zip |
typedFunction undoes eta-expansion regardless of expected type
When recovering missing argument types for an
eta-expanded method value, rework the expected type
to a method type.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/fun_undo_eta.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/pos/fun_undo_eta.scala b/test/files/pos/fun_undo_eta.scala new file mode 100644 index 0000000000..466b0e2629 --- /dev/null +++ b/test/files/pos/fun_undo_eta.scala @@ -0,0 +1,10 @@ +class Test { + def m(i: Int) = i + + def expectWild[A](f: A) = ??? + def expectFun[A](f: A => Int) = ??? + + expectWild((i => m(i))) // manual eta expansion + expectWild(m(_)) // have to undo eta expansion with wildcard expected type + expectFun(m(_)) // have to undo eta expansion with function expected type +} |