diff --git a/tests/pos/i11318a.scala b/tests/pos/i11318a.scala new file mode 100644 index 000000000000..6422b32a375e --- /dev/null +++ b/tests/pos/i11318a.scala @@ -0,0 +1,4 @@ +extension(a: Int) + def b: Int = ??? + def h: Unit = + [A] => (r: Int) => b diff --git a/tests/pos/i11318b.scala b/tests/pos/i11318b.scala new file mode 100644 index 000000000000..b8bf2203d218 --- /dev/null +++ b/tests/pos/i11318b.scala @@ -0,0 +1,13 @@ +type FunctionK[A[_], B[_]] = [Z] => A[Z] => B[Z] +type ~>:[A[_], B[_]] = FunctionK[A, B] + +trait RepresentableK[F[_[_], _]]: + type RepresentationK[_] + + def tabulateK[A[_], C](f: RepresentationK ~>: A): F[A, C] + + extension[A[_], C](fa: F[A, C]) + def indexK: RepresentationK ~>: A + + def mapK[B[_]] (f: A ~>: B): F[B, C] = + tabulateK([Z] => (r: RepresentationK[Z]) => f(indexK(r))) diff --git a/tests/pos/i11318c.scala b/tests/pos/i11318c.scala new file mode 100644 index 000000000000..b1da38d7f6da --- /dev/null +++ b/tests/pos/i11318c.scala @@ -0,0 +1,6 @@ +extension(a: Int) + def b: Int = ??? + def h: Unit = + new Function1[Int, Int] { + def apply(r: Int): Int = b + }