Add a regression test for scala/bug#12192

This commit is contained in:
Georgi Krastev 2020-10-29 16:43:53 +01:00
parent 56ac9d6b8b
commit dd0695ed79
1 changed files with 19 additions and 0 deletions

View File

@ -16,4 +16,23 @@ object Test {
def applied(narrow: Template[Narrow]): High[narrow.Copy] //ok
def indirect(narrow: Template[Narrow]): High[({ type T[+A <: Narrow] = narrow.Copy[A] })#T] //also ok
}
trait Expr[X, E] {
def applyTo[F[A >: E <: E]] :Expr[X, F[E]]
}
trait Functor[F, A <: U, U] {
type Apply[+X <: U]
type Super[+X >: A <: U] >: F
}
trait Implicit[X, Y] {
type S >: Y
val expr :Expr[X, S]
}
def test[F, A <: U, U, X](fun :Functor[F, A, U], x :Implicit[X, A] { type S >: A <: U }) = {
x.expr.applyTo[({ type E[B >: A <: U] = fun.Super[B] })#E]
x.expr.applyTo[fun.Super]
}
}