aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-10-05 16:09:17 +0200
committerGuillaume Martres <smarter@ubuntu.com>2016-10-12 03:36:57 +0200
commitbafc0a397e28c6e46619f413c9a5648026eac303 (patch)
tree51207f7e43beb19ced1260bce99b85977b155709 /tests/pos
parent8897b46fd41437c8ff1a91fad4a58ed452c3c35c (diff)
downloaddotty-bafc0a397e28c6e46619f413c9a5648026eac303.tar.gz
dotty-bafc0a397e28c6e46619f413c9a5648026eac303.tar.bz2
dotty-bafc0a397e28c6e46619f413c9a5648026eac303.zip
Harmonize PolyType and TypeLambda
Let them inherit the same traits and push as much functionality as possibly into the common superclass GenericType.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/sams.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pos/sams.scala b/tests/pos/sams.scala
index b7ef7dd2d..20338b95c 100644
--- a/tests/pos/sams.scala
+++ b/tests/pos/sams.scala
@@ -73,3 +73,16 @@ class T {
def app[T, U](x: T)(f: F[T, U]): U = f(x)
app(1)(x => List(x))
}
+
+object SI9943 {
+
+class Foo[T] {
+ def toMap[K, V](implicit ev: Foo[T] <:< Foo[(K, V)]): Foo[Map[K, V]] = null
+ def toMap[K](keySelector: T => K): Foo[Map[K, T]] = null
+}
+
+object Foo {
+ val f: Foo[Int] = null
+ val m = f.toMap(_ % 2)
+}
+}