Skip to content

Fix #7452: Add regression test #11532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/pos/i7452.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
trait Abstract[F[_], A] {
type Out[G[_]]
}
object Abstract {
type Aux[F[_], A, Out0[_[_]]] = Abstract[F, A] { type Out[G[_]] = Out0[G] }

implicit def valueAbstract[F[_], A]: Aux[F, F[A], [G[_]] =>> G[A]] = new Abstract[F, F[A]] {
type Out[G[_]] = G[A]
}

implicit def hkdAbstract[F[_], A[_[_]]]: Aux[F, A[F], [G[_]] =>> A[G]] = new Abstract[F, A[F]] {
type Out[G[_]] = A[G]
}
}

case class StringF[F[_]](s: F[String])

trait Q[M[_[_]]] {
def map[A, M2[_[_]]](f: M[Option] => A)(implicit abs: Abstract.Aux[Option, A, M2]): Q[M2]
}

val q: Q[[F[_]] =>> F[String]] = ???
val q2 = q.map(s => s) // was an error, now OK
val q3 = q.map(s => StringF(s))