From 26bc2772dc5c5c1b205df5a05f81d66d1106d977 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Sun, 8 Mar 2020 22:38:32 +0100 Subject: [PATCH] Fix #4668: Add regression test --- tests/neg/i4668.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/neg/i4668.scala diff --git a/tests/neg/i4668.scala b/tests/neg/i4668.scala new file mode 100644 index 000000000000..468de58b7d9f --- /dev/null +++ b/tests/neg/i4668.scala @@ -0,0 +1,11 @@ +trait Type { type T } +object Type { implicit def Type[S]: Type { type T = S } = new Type { type T = S } } + +trait Type1 { type T[_] } +object Type1 { implicit def Type1[S[_]]: Type1 { type T[A] = S[A] } = new Type1 { type T[A] = S[A] } } + +trait Functor[F[_]] { def map[A,B](x: F[A])(f: A => B): F[B] } +object Functor { implicit object listFun extends Functor[List] { def map[A,B](ls: List[A])(f: A => B) = ls.map(f) } } + +val map: (A:Type,B:Type,F:Type1) ?=> (Functor[F.T]) ?=> (F.T[A.T]) => (A.T => B.T) => F.T[B.T] = + fun ?=> x => f => fun.map(x)(f) // error // error // error: Missing parameter type