Skip to content

Commit 5b2d4af

Browse files
Backport "Fix #19633: Add regression test." to LTS (#21019)
Backports #20013 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 9c615de + afc643a commit 5b2d4af

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)