Skip to content

Commit afc643a

Browse files
sjrdWojciechMazur
authored andcommitted
Fix #19633: Add regression test.
Not sure what fixed it, but it seems to be good now. [Cherry-picked 230519f]
1 parent 9c615de commit afc643a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/pos/i19633.scala

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
object Repro {
2+
trait Responsive {
3+
type Response
4+
}
5+
6+
object Responsive {
7+
type Aux[R] = Responsive {type Response = R}
8+
type Response[R] = R match {case Aux[r] => r}
9+
}
10+
11+
case class StringRequest(name: String) extends Responsive {
12+
type Response = String
13+
}
14+
15+
def withImplicit[R <: Responsive](request: R)(implicit ct: scala.reflect.ClassTag[Responsive.Response[R]]): Responsive.Response[R] = ???
16+
17+
def withFunction[R <: Responsive](request: R)(call: R => Responsive.Response[R]): Responsive.Response[R] = ???
18+
19+
def stringWithFunction(req: StringRequest): String = withFunction(req)(_.getClass.getSimpleName)
20+
21+
def stringWithImplicit(req: StringRequest): String = withImplicit(req)
22+
23+
def main(args: Array[String]): Unit = {}
24+
}

0 commit comments

Comments
 (0)