From 7f721438b5bccc8ca9dd68cef273c8cac8199e1a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 18 Jun 2014 18:20:14 +0200 Subject: Handling higher-kinded types with lambdas Switch to the new scheme where higher-kinded types (and also some polymorphic type aliases) are represented as instances of Lambda traits. --- tests/pos/polyalias.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/pos/polyalias.scala (limited to 'tests/pos/polyalias.scala') diff --git a/tests/pos/polyalias.scala b/tests/pos/polyalias.scala new file mode 100644 index 000000000..07bb241f0 --- /dev/null +++ b/tests/pos/polyalias.scala @@ -0,0 +1,26 @@ + +object Test { + + type S = scala.Predef.Set + + val z: S = ??? + + + type Pair[T] = (T, T) + val x = (1, 2) + val xx: Pair[Int] = x + val xxx = xx + + type Config[T] = (T => T, String) + + val y = ((x: String) => x, "a") + val yy: Config[String] = y + val yyy = yy + + type RMap[K, V] = Map[V, K] + type RRMap[KK, VV] = RMap[VV, KK] + + val rm: RMap[Int, String] = Map[String, Int]() + val rrm: RRMap[Int, String] = Map[Int, String]() + +} -- cgit v1.2.3