Skip to content

Commit

Permalink
Fix scala#11318: add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
anatoliykmetyuk committed Jul 16, 2021
1 parent e0e89a8 commit 300208c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/pos/i11318a.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extension(a: Int)
def b: Int = ???
def h: Unit =
[A] => (r: Int) => b
13 changes: 13 additions & 0 deletions tests/pos/i11318b.scala
Original file line number Diff line number Diff line change
@@ -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)))
6 changes: 6 additions & 0 deletions tests/pos/i11318c.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extension(a: Int)
def b: Int = ???
def h: Unit =
new Function1[Int, Int] {
def apply(r: Int): Int = b
}

0 comments on commit 300208c

Please sign in to comment.