aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/t1236a.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-06-19 13:41:18 +0200
committerMartin Odersky <odersky@gmail.com>2014-06-19 13:41:18 +0200
commit91e44df57185a32988c22823551d8049b3c43da8 (patch)
tree79d73bb9f528b2f635cb1d8487e4c8a8a5756690 /tests/pos/t1236a.scala
parent76238566c281b9d87b17c7e361feb649ceb7a6d0 (diff)
downloaddotty-91e44df57185a32988c22823551d8049b3c43da8.tar.gz
dotty-91e44df57185a32988c22823551d8049b3c43da8.tar.bz2
dotty-91e44df57185a32988c22823551d8049b3c43da8.zip
Fixes to lambda abstraction
1) Honor variance of Apply and $hkArgs when instantiating them 2) Eta-lifting a higher-kinded type is straight eta expansion, no arguments are applied.
Diffstat (limited to 'tests/pos/t1236a.scala')
-rw-r--r--tests/pos/t1236a.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pos/t1236a.scala b/tests/pos/t1236a.scala
new file mode 100644
index 000000000..a1a5a81f4
--- /dev/null
+++ b/tests/pos/t1236a.scala
@@ -0,0 +1,15 @@
+trait Empty[E[_]] {
+ def e[A]: E[A]
+}
+
+object T {
+ val ListEmpty = new Empty[List] {
+ def e[B] = Nil
+ }
+
+ // needs better type inference for hk types
+ def foo[F[_]](q:(String,String)) = "hello"
+ def foo[F[_]](e: Empty[F]) = "world"
+
+ val x = foo[List](ListEmpty)
+}